Monsters Moving
monster LR
Go into the object monster LR and add the Create event…
- Move Fixed – left and right, speed “6” (a bit slower than our player)
Add the event Collision with wall with the action Reverse Horizontal
monster UD
Go into the monsterUD object. Add the Create event
- Move Fixed – up and down, speed “6”
In the Collision with wall event, add the action Reverse Vertical
Testing
Test it out. Do your monsters move properly?
Losing Lives
Go into your person object and the following:
- Collision with monsterLR
- Sleep
- Set Lives – lose a life (make sure it’s relative or else you hit one monster and the game will be over, you’ll have less than 0 lives!)
- Jump to Start
Duplicate the Collision with Monster LR for the Collision with monster UD…
Your person should look like this…
Test your game – if you run into a monster, do you “die” (pause/sound, person where started)?
If yes, continue.
Facing Directions
monster LR
Change the monsterLR object’s sprite to “monster1_nice”
Now we will have the monster facing whatever direction it’s moving in. Add the End Step event…… what is the monster doing just after it hits a wall?
- Test Variable: if hspeed (horizontal speed) is smaller than 0 (if going left), then…
- Change Sprite: left-facing monster sprite, subimage “3”, speed “0”
- Else
- Change Sprite: right-facing monster sprite, subimage “2”, speed “0”
Test it out – make sure the monsters move left/right without spinning like this…
monster UD
First change the sprite for the object to “monster2_nice”…
Add a new event End Step and the following actions:
- Test Variable: is vspeed (vertical speed) smaller than 0, going up?
- Change Sprite: “monster2” sprite, change subimage to “1” (going up)
- Else
- Change Sprite: “monster2” sprite; change subimage to “0” (going down)
Test your game; make sure the monster faces up/down without spinning.
Get it Checked Off
Keep it open in the testing level to get checked off.
Playing Level
Continue the game – hit ‘N‘ key to go to the next room with the monsters…
Hit the ‘S‘ key to restart the level with 5 lives.
Play the level until you are able to complete the level it; when you’ve collected all the diamonds, you should have a score of 100 (20 diamonds x 5 pts).
Keep the pop-up window open to get checked off.