Starting File

Open the starting file. You can be in Simple 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

We also need to make the player stop moving when no arrow keys are pressed. So we need to add an event for <No Key>

Add the following actions…

  • Check Grid (32×32)
  • Move Fixed: center, speed 0

Hitting the Wall

We need to make sure the person also stops moving if the player hits a 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). 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)

If you want, you can save time by copying the Change Sprite action you just added (and pasting it as shown in the arrow events).

<Down> event

  1. Go into your <Down> Keyboard event and paste it (CTRL+V).
  2. 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

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

<Right> event

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

<Up> event

  1. Go into your <Up> Keyboard event and paste it (CTRL+V).
  2. Drag it down and add the Start End blocks.
  3. 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!)
  • Destroy instance (self/default, make the diamond disappear)

To add the Destroy Instance action, go to the 2nd tab…

Room

Go into the room “Testing#1“.

On the top left, click in an empty area and choose the diamond object. Once it’s showing as the object…

Then click on the room to add 3-5 diamonds near the person in your testing room.

Test out your game – when you collect the diamonds, the score should go up by 5 points…

Goal

Go into the goal object, and add the event to Collision with person.

Then start by adding these actions from the 3rd tab…

  • Sleep – pause for 1000 milliseconds (defeault, = 1 sec)
  • Display Message – type in ‘Room done’
  • Restart Game

Now go to the 2nd tab and add the Test Room and Next Room actions…

Add the Else action between the last 2 actions like this…

When you’re done, the event should look like this…

Room

Go into your room – change the object to the flag/goal…

Click and add the flag in a top-left corner. 

Test it out. When you reach the flag, you should get the pop-up message like this.

Click on OK to close it and restart the game.

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…

Room

Go into the testing room and add a few doors to block the flag.

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.