Blue Balls Of Evil
3 Character Movement

Section Menu

Blue Balls Of Evil Home | 1 | 2 | 3 | 4 | 5 | 6

Making The Enemies Move

We will start this section by getting the movement sorted for the blue balls. Double click on the obj_enemy_up_down object to bring up its window. We will start by making it so that the up/down enemy moves up and down the screen bouncing when it hits a green square.

Add a Create event to the object. Drag in a Game Maker Screenshot Start Moving icon and fill in the pop-up window as shown below,

Game Maker Screenshot

To make the ball change direction when it bumps into a green square, add a Collision event with the obj_edge (green square). Drag a Game Maker Screenshot Bounce action into this event.

Creating the Other Enemies

To save a little bit of time, we can make the 2 other types of enemy by copying the one we have just made. Click with the right mouse button on the enemy object and choose Duplicate. Do this so that you have another 2 enemy objects. Call these, obj_enemy_left_right and obj_enemy_bouncing.

Edit the Create event of the obj_enemy_left_right so that the start moving action is as shown below.

Game Maker Screenshot

Edit the Create event of the obj_enemy_bouncing so that the start moving action is as shown below.

Game Maker Screenshot

Making The Player's Character Move

We need to make the character object move whenever the player presses one of the arrow keys. We need to make sure that the player cannot move the character over the green squares (the edge of our maze). Start by double clicking on the obj_char to bring up its window.

Add an event for the pressing of the left arrow (Click on Add Event, Keyboard, Left). We need 2 actions. Start by going to the Control tab and dragging in a Check Object icon. Fill in the pop-up window as shown,

Game Maker Screenshot

This action checks that moving the character will not allow it to overlap a green square.

Next drag in a Jump action and fill it in as follows,

Game Maker Screenshot

To allow the character to move to the right, add a keyboard event for the right arrow key - just like you did for the left. You will need the same 2 actions as before but will need to fill in the pop-ups as shown below,

Game Maker ScreenshotGame Maker Screenshot

To move up...

Game Maker ScreenshotGame Maker Screenshot

To move down...

Game Maker ScreenshotGame Maker Screenshot

Test The Game

Add the character object to the screen and some of the up/down blue balls. Save your work and press the play button (or F5) to test that the objects move as expected.

⇐ Previous | Next ⇒