Enemies and Health
Every game needs an enemy to battle, and ours is a small retro ninja. Using math once again, we can create variables for our hero’s health that is subtracted each time there it detects a hit with the ninja. This requires the use of conditionals once again with a graphic health bar that has a width that gets modified according to your players health.
Use the left and right arrow keys to cause the character to move. Pressing the up key will cause the character to jump into the air. If it’s not working, please click on the stage first to activate the controls.
You need Adobe Flash Player to view this content.