Starting File
Open GameMaker and then go to File > Open. Then click on Home > GameMaker …


Open the maze starting file. You can be in Simple Mode or Advanced Mode. Expand Objects – click on the “+” beside the folder (or double-click on the folder). So you should see all the objects like this…


Person Moving
Moving Left
Go into the person object and add the <Left> Keyboard event…

Start by adding the Check Grid action…

Set it to 32 x 32 (the same as our room, this is the size of our sprites).

Then add the Move Fixed action…

Set it to speed 8, and click on the left arrow.

So your <Left> Keyboard action should look like this…

Moving Right
Duplicate the event to create the following events and just change the move action to the <Right> Keyboard event…

So you should have this…

Double-click on the Move action and change the arrow/direction to the right.

Moving Up
Duplicate one of the arrow events for <Up>, changing the Move arrow to up (keeping speed 8).


Moving Down
Duplicate one of the arrow events for <Down>, changing the Move arrow to down (keeping speed 8).


Person Stop Moving
No Key
RIght-click on any of the Keyboard events, and Duplicate… choose Keyboard … <No Key>


Go into the Move Fixed: change the direction to center, change the speed to “0”


Hitting the Wall
Duplicate the <No Key> event… choose Collision with wall.


So you should have this…

Test it out
Save your game/file, then test it out.

Make sure the person:
- moves properly with the arrow keys
- doesn’t move when you have no keys pressed
- doesn’t go through walls
- doesn’t get stuck
If everything’s good, keep going.

Facing Directions
Change sprite
Go into your person object and use the drop-down menu to change the sprite to person_nice


When room loads (not spinning)
Add a Create event (when the room loads).

Go to the 2nd action tab, drag the action Change Sprite over…

- sprite = “nice” sprite you are using for your player
- subimage = 0 (front facing)
- speed = 0 (so it doesn’t spin)


Copy the Change Sprite action you just added.

<Down> event
- Go into your <Down> Keyboard event and paste it (CTRL+V).
- Then drag it so it’s the last action. Add Start and End blocks around the Move and Change Sprite actions like this.


<Left> event
- Go into your <Left> Keyboard event and paste it (CTRL+V).
- Drag it down and add the Start & End blocks.
- Double-click to go into Change Sprite and change the subimage to 3


<Right> event
- Go into your <Right> Keyboard event and paste it (CTRL+V).
- Drag it down and add the Start & End blocks.
- Double-click to go into Change Sprite and change the subimage to 2


<Up> event
- Go into your <Up> Keyboard event and paste it (CTRL+V).
- Drag it down and add the Start & End blocks.
- Double-click to go into Change Sprite and change the subimage to 1


Test it Out
Save your game/file, then test it out.

You don’t have to change anything in your room. Just test it and you should see your person changing directions, not spinning…

Diamond
Go into the diamond object. First add the event Collision with person…
- Set Score: set to 5 points (make sure it’s relative or the score won’t go up!)


To add the Destroy Instance action, go to the 2nd tab. It’s just the default (make the diamond disappear).

So your diamond object should look like this…

Door
Go into the door object. You want the door to disappear when all the diamonds are gone. So you have to test that object, that it’s equal to zero. First add the Step event…

Start by adding the Test Instance Count action – set it “diamonds” equal to 0.


Then add the Destroy Instance action.

The Step event should look like this…

Save your game and test it out. When you collect all the diamonds, the door should disappear.


Get Checked Off
If the door works, keep the game open in play mode to get checked off.
- Don’t click on the flag! Hit the R key to restart the room.
- If you clicked on the flag, click OK and then hit the N key until you’re back to this room.
