Platformer

Move through the world and shoot the enemies!


Play this demo in full screen.

1) Set your background to a color or image, and create a sprite for the ground.


Play this demo in full screen.

2) Make a sprite for your main character, and make it move left and right with the arrow keys.


Play this demo in full screen.

3) Make two obstacles for your sprite, and store them in a list.


Play this demo in full screen.

4) Using your list, make it so your character can't move past the obstacles.


Play this demo in full screen.

5) Now let's get your character to jump. Firstly, if she/he isn't touching the ground or the top of an obstacle, make her/him fall. Test your code by making your sprite start above the ground.


Play this demo in full screen.

6) Now make your character move up when you press the up arrow. (When she/he stops moving up, she/he should automatically fall).


Play this demo in full screen.

7) Make your character shoot fireballs when you press the space bar. Make the fireballs bounce off the ground and the obstacles.


Play this demo in full screen.

8) Make enemies that appear randomly on the right side of the screen and move across.


Play this demo in full screen.

9) Make the enemies turn around when they hit an obstacle.


Play this demo in full screen.

10) Make the enemies disappear when they get hit by a fireball.


Play this demo in full screen.

11) Give your player five hearts at the start of the game.


Play this demo in full screen.

12) Make your player lose a heart when she/he touches an enemy.


Play this demo in full screen.

13) Make the game end if you lose all your hearts.


Play this demo in full screen.

14) Now let's make your player able to keep moving through the world. First, make it so that when your player gets to the right edge of the screen, she/he reappears on the left side.


Play this demo in full screen.

15) When your player reappears on the left side, make the obstacles disappear and make new ones appear in new spots.


Play this demo in full screen.

16) Make any enemies that are on the screen disappear when your player reappears on the left side.


Play this demo in full screen.

17) Make a hidden variable called "subLevel" and make it go up every time you reappear on the left side of the screen.


Play this demo in full screen.

18) Now make different obstacles appear for each sublevel. Make three sublevels.


Play this demo in full screen.

19) After the third sublevel, we need a boss level, so make all of the obstacles disappear, and make the enemies stop spawning.


Play this demo in full screen.

20) Make a boss sprite appear when you get to the boss level. Make the boss move quickly back and forth on the screen.


Play this demo in full screen.

21) Make a variable for the boss' health, and make it appear on the screen. Make the health go down when a fireball hits the boss.


Play this demo in full screen.

22) Make the player lose a heart when the boss touches her/him, and make the boss change direction.


Play this demo in full screen.

23) When the boss' health gets to zero, make the boss disappear, and give the player all her/his hearts back.


Play this demo in full screen.

24) Now you have all the basic ingredients for your game, so it's time to get creative. Make more levels, more enemies, more bosses, and even powerups for your player. It's all up to you!


Play this demo in full screen.