Ghost Invaders
8 Adding Barricades

Section Menu

Ghost Invaders Home | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9

In classic Space Invaders, there are some barricades which the player can hide beneath. Bullets from the ship as well as the bombs from the invaders gradually destroy the barricades. This feature adds interest to the game and the barricades make it awkward for the player to aim at the ghosts.

Start by adding a new sprite called spr_barricade. Load the barricade graphic. Make sure that this sprite is not set to transparent.

Game Maker Screenshot

Create an object using this sprite called obj_barricade.

Add the small green squares to the room in a pattern like the one you see in the screenshot.

Game Maker Screenshot

Open up the barricade object's window and add two Collision Events. One should be with obj_ship and one with obj_bomb. In both cases we need to make sure that the barricade instance is destroyed and that the boom sound is played.

Both events should look like the screenshot,

Game Maker Screenshot

We also need to make sure that the bullets and bombs disappear when they hit a section of the barricade.

Go to the object windows for these objects and add a Collision Event with the barricade. Drag in a Destroy Instance icon.

Game Maker Screenshot

Game Maker Screenshot

⇐ Previous | Next ⇒