The student will learn basic Pygame commands and create a template for all future programs. We will learn how to create a window, adjust window size, change window name, set FPS (frame-rate per second control), and use the main loop that will refresh the screen indefinitely.
The student will use the knowledge gained in previous levels to create the background and program its movement, load images for the spaceship, and create controls.
Later, the student will program intermittent shots of the spaceship using a "sprite group" and a "timer," as well as learn to adjust the volume of the sounds.
Afterward, the student will learn to create an alien that will explode with a special animation and sound if it collides with the main character's shot, and eventually, he or she will learn to create a group of different aliens that will move according to a specific algorithm and randomly shoot in the direction of the main game character.
The student will learn how to add gravity to games, adjust the fall speed, create a takeoff using the Space key, add sounds, and make the character to tilt to the side of the flight. In addition, a counter in the middle of the screen will be added and programmed to update when an obstacle is passed. The student will create a game at the end of the module that he or she can later improve.
The student will become familiar with the concepts of "sprite" and "rendering" as well as the "inheritance" paradigm from OOP and the attributes and coordinates of each sprite. At the end of the module, the student will be asked to create a game that she or he can later improve.
The student will master drawing lines on the background and creating a random appearance of platforms on the screen, as well as creating different animations of the main game character, programming its movements, learning how to unfold images horizontally, adding gravity similar to the previous project, and adding camera movement following the character's movement. The student will create a game at the end of the module that he or she can later improve.
Additional projects are selected depending on the student's preferences.
- Window creation, screen updates and event handling
- Rendering and animation without classes
- Rendering and animation with a classes
- Sprite • Rendering the background and sprite• Updating a sprite • Group of sprites • Random appearances• Main character • Animation, controls, and sound • Obstacles, random appearances and collisions • Gameover • Fonts and a scoreboard
- Background, rendering layers and background movement • The main character, animation and obstacles • Gravity, image rotation and a score counter • Checkpoints, gameover and calculation of intersection with certain coordinates
- The creation of platforms and the drawing of lines in the background• Main game character• Jumping and shifting the camera while controlling the main character • Intersection with a point, jump animation, and platform color at random • Platform behavior, spring calculation, scoreboard, and gameover
- Space and the spaceship• Timed shots and volume sounds• Image generator and explosion animation• Movement, generation and attack sprites • Main game character health and health level display
- Music player• Platformer • Fifteen puzzles game• Labyrinth