You need to use the starting file. You should be able to expand the Objects folder and see these objects ready to go, and the Rooms folder has a room in it.


Bat
Bat doesn’t leave the room.
Open the bat object and add the following action:
- Collision with wall
- Bounce (all objects)


Bat Moving
Make the bat move a bit left or right of where it is by adding Keyboard events for <Left> and <Right> … for each event add the Jump to Position action – setting the X values (Left = “-12”, Right = “12”), and checking the relative box.




Ball
Ball moves on its own
Open the ball object. Add the Create event with the Move action (4 corners, speed 8).


Ball bouncing off walls
- Collision with wall
- Bounce (all objects)


Ball bouncing off bat
- Collision with bat
- Bounce (precisely, all objects)


Ball bouncing off stones
Add more events… Collision with all the stones. You can duplicate the Collision with bat event for all the stones – they’re all bouncing precisely with all objects…
- Collision with stone
- Collision with damaged1
- Collision with damaged2
- Collision with damaged3

When you’ve duplicated that event for all the stones, your ball object should look like this…

When ball leaves the room
Add another event: Collision with die
- Jump to Start (default)
- Set Lives to “-1”, relative
- Sleep (just pauses 1 second)




If ball stuck going straight up & down
Sometimes the ball will get stuck going straight up and down, so we will add a cheat code with the Space Bar event and have it move at an angle.


Save then test the game.

Stones Decaying
Change into next type of stone
In the ball object, we need to add some an action to the Collision events (with the stones).
- in the Collision with stone event you already have…
- Change Instance (other, change into “damaged 1”, perform “not”)
set to “other” (or else it will affect the ball if set to “self”).
- Change Instance (other, change into “damaged 1”, perform “not”)



- Collision with damaged1
- Change Instance (other, change into “damaged 2”, perform “not”)

- Collision with damaged2
- Change Instance (other, change into “damaged 3”, perform “not”)

The last one, we again change it into the last damaged stone, but this time say “yes” to perform so it performs the event under the “damaged3” object.
- Collision with damaged3
- Change Instance (other, change into “damaged 3”, perform “yes”)


Make last stone disappear
So when the last stage of stone appears, we want it to totally disappear. We also want to give the player points every time we destroy a stone. This must be before it’s destroyed or it won’t happen!
Go into the damaged3 object. Add a Create event with a Destroy Instance action (default/self).

- also add the action Set Score to 10, relative

So your damaged 3 should look like this…

Save then test the game. Do the stones get destroyed gradually? If you see it work for a couple stones, you can keep going.

Score, Lives
Obj: controller
Go into the controller object.

- Create
- Set Lives to 10, not rel.
- Set Score to 0, not rel. (= default)


- No More Lives
- Show highscore table (default sttgs)
- Restart the Game



- Draw with these 2 actions: Draw Score & Draw Lives…
- Draw Score (40,40), caption “Score:”, not relative
- Draw Lives (150, 40), caption “Lives:”, not relative



So the Draw event looks like this…

Save and test it out. When you’re playing you should see the score and lives at the top with spacing before the stones start. When you start your game it should look like this…

After playing a bit, you should see the score and lives amounts change…

All Stones Destroyed?
Now we need to set things up for what happens when all the stones are destroyed.
- Create a variable that will first count how many stones are in the room.
- Then have a Step event so it constantly checks if all the stones are gone.
Count how many stones in room
Go into your controller object. In the Create event and add Set Variable – give it a name MyStones and type in instance_number(stone). Make sure you use round brackets, and that your “stone” object name matches.

Check if all stones gone
Then add a Step event with the following actions:
- Test Score – see if all the stones are gone = calculation of “My Stones” multiplied by 10pts each – when player reaches that score, it means all the stones are gone.
- If yes, then (put both inside start & end blocks)…
- Display message “Congratulations!# You’ve completed the game”
# means it goes onto the next line in the message. - Show highscore table
- Restart the game
- Display message “Congratulations!# You’ve completed the game”

Save and run the game. Now when you play your game:
- Show the teacher when you’ve destroyed a few stones, how it looks.
- Continue playing until all the stones are destroyed – call the teacher over to see when you’ve destroyed all the stones and get the message.
