Explosion
Go into the object explosion and start by adding the Create event. Add a Destroy Instances action.
Check the box for relative.
Copy the Destroy Instances action (CTRL+C) and paste it (CTRL+V) 8 times (so you have a total of 9 of them).
We want the bomb to destroy walls & monsters in the blocks around it as well.
Start by setting the first one’s X & Y values as shown below, and make it relative.
- X = 16, Y = -16
Set the X & Y values as follows. (They should all be relative).
- X = 16, Y = -16
- X = 16, Y = 16
- X = 16, Y = 48
- X = -16, Y = -16
- X = -16, Y = 16
- X = -16, Y = 48
- X = 48, Y = -16
- X = 48, Y = 16
- X = 48, Y = 48
If you go to “Show Information” (just above the OK button on the left), it should look like this – and it’s a quick way to see if you have any mistakes like in my example picture…
Check the values. To get out of this view, click on the check mark button…
If you don’t see this option, save your game and then go to File > Advanced Mode.
Then go to File > Recent Files … to open your game again quickly.
Add one more event: Animation End with the Destroy Instance action.
Trigger
Go into the object trigger and add the Collision with person event with the following actions:
- Change Instance: changes the bomb object into the explosion object; set perform to “yes”
- Destroy Instance
Testing Level
Test the functionality of the trigger and bombs.
If it works, get it checked off – keep the game in play mode. Since you have the main controller in your testing room, it’s easy to blow it up over and over to get checked (use the “R” key to restart the room).
Keep it open in the testing level to get checked off.
Playing Level
Continue the game – hit ‘N‘ key to go to the playing level with the bombs.
When you play this game, you should get 200 points when you’ve collected all the diamonds.
Keep it open in play mode with the person in a safe place like below, or with the “room done” pop-up window.