How to gamemaker: shooting enemies

GameMaker: Shooting Enemies

541
STEPS
TOOLS

Add a sprite and image for the enemy bullet.

Add a sprite and image for the enemy bullet.

Add a Step Event for the Enemy

Add a Step Event for the Enemy

Add a "Test Chance" action.  Depending on how frequent you want your guard to shoot, change the number a sides (1 being the most frequent).

Add a "Test Chance" action. Depending on how frequent you want your guard to shoot, change the number a sides (1 being the most frequent).

Add a "start of a block" and "end of a block" action.  In between the arrows, add a "create a moving instance" action.

Add a "start of a block" and "end of a block" action. In between the arrows, add a "create a moving instance" action.

Double click on the "create a moving instance" action and apply it to self. Select the enemy bullet as the object. If you want the bullet to come from the shoulder of the guard, select 8 for x and y.

Double click on the "create a moving instance" action and apply it to self. Select the enemy bullet as the object. If you want the bullet to come from the shoulder of the guard, select 8 for x and y.

Type in direction for direction and set the bullet relative to the guard (check the relative box).  And there you have it!  Your enemy can now shoot!

Type in direction for direction and set the bullet relative to the guard (check the relative box). And there you have it! Your enemy can now shoot!

Make sure your character will lose a life when hit by the bullet and destroy the instance after it hits your character.

Make sure your character will lose a life when hit by the bullet and destroy the instance after it hits your character.

  • GameMaker Studio App
  • Bullet Image
  • Enemy Sprite and Object