Score panel

Ojb: life controller

Create a new object called life controller. It does not need a sprite as we will control the drawing itself using the drawing event. Make the depth -10000 so it's in front of everything else.

Add a Create event 

  • Set Score: to 0
  • Set Lives: to 3
  • Set Health: to 100

Add a Draw event:

  • Draw Sprite: sprite = bottom, x = 0, y = 404
    = 480 (room height) - 76 (height of bottom graphic)
  • Set Color: yellow
  • Draw Score: x = 180, y = 440 
    caption - delete, no caption, it's already on the background
  • Draw Health: x1=12, y1=449, x2=138, y2=459
    back color = none, bar color = green to red
  • Draw Life Images: x=25, y=410; sprite life

Room

Add the life controller to your room.

Test it out - does the score panel look like this when playing?

Ending the Game

Add a Step event that checks the score. When the player has more than 200 points, the game ends. (normally you'd set the amount to much higher, but we're keeping it low so you can easily see it works). They'll get a message and be able to put their name in the high score table and restart the game.

If you test out your game, hold the Space Bar to keep shooting and go back and forth along the bottom of your screen to get the score up quickly. Once you get the score to over 200, you should see the high score table.