11. Adding Damage
While you were testing your game you may have noticed that the enemies were not harming your character. What's the fun in that? Let's add the instructions to Game Maker so that something happens when these objects collide.
Double-click the hero object. When the object properties window appears, click add event and select the collision event. From the drop-down menu select the horizontal enemy.
Now that we have added the collision event to the horizontal enemy we must do the same for the vertical enemy.
Right click the collision event with the horizontal enemy and select duplicate event. When the event selector window appears select collision and then the vertical enemy from the drop-down menu.
ow try retesting your game by clicking the run the game button. This time, if you run into an enemy, the game will restart from beginning. If you are having a probmlem with one of the objects, check the help file named helpFile03.gmk in the files you downloaded earlier. Compare your work with this file to see if you can find the problem and correct it.