Description

Displacement in the direction. The character is moved by 1 pixel * speed. Returns the new position of the character :

{x: Integer, y: Integer}
  • Sprites on the scene are automatically refreshed.
  • This method is not executed for player if the freeze property is true

Usage

Parameters

  • dir {String}

    Direction : up, bottom, left or right

  • isPassable {boolean} optional

    (optional) Function called at the end of the movement. If true, returns an object containing the tile passibility :

    {
        pos: {x: Integer, y: Integer},
        passable: Boolean
    }
    

Returns

Object

Discussion