Facing Directions

person

To have a person/monster facing direction moving, you need a sprite with 4 subimages for each direction. These are the ones loaded in your game you can use:

  • subimage "0" = front (when room loads, going down)
  • subimage "1" = back (when going up)
  • subimage "2" = right
  • subimage "3" = left

change sprite

Go into your person object and change the sprite to person_nice

not spinning when room loads

  • Add a Create event (when the room loads) 
    • Change Sprite:
      • 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

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.

We don't have to change the subimage for the Change Sprite action as we want the person to be facing the front (subimage "0"), the same as when the room loads.

other keyboard events

Go into the other keyboard events:

  1. paste the Change Sprite action
  2. add the Start & End blocks (make sure the move & sprite actions are inside them)
  1. Double-click to go into Change Sprite and change the subimage to the appropriate number. 
  • <Left>  = subimage to "3"
  • <Right>  = subimage to "2"
  • <Up>  = subimage to "1"
Left = subimage "3"
Left = subimage "3"
Right = subimage "2"
Right = subimage "2"
Down = subimage "0"
Down = subimage "0"

Room

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