TilemapCharacter._inputState (direction)
Looks at both keyboard and gamepad state data to determine movement
TilemapCharacter.boxInGrid (box)
TilemapCharacter.calcFutureCoords (pos, vel)
Applies one tick of velocity to the position, and returns the final cell co-ordinates
TilemapCharacter.clearDestinations ()
Remove any destinations that were added with setDestination()
TilemapCharacter.generateCollisionBox ()
Constructs a collision box based on the bounding boxes of all sprites belonging to the scene object.
TilemapCharacter.getNextDestination ()
Get the next destination
TilemapCharacter.handleTileTransition (futureCoords)
Tests and handles moving into a new tile
TilemapCharacter.illegalTile (dest, exception)
Returns true if either the tile is off the grid, or the tile contains a collidable object
TilemapCharacter.inGrid (x, y)
Helper Function - Returns whether the co-ordinates are inside the tilemap boundary
TilemapCharacter.onAddToScene (params)
Initialises the collision box and sets the local rotation value from the parent
TilemapCharacter.onKeyDown (data)
Updates keyboard state
TilemapCharacter.onKeyUp (data)
Updates keyboard state
TilemapCharacter.onUpdate ()
Update character state based on user input
TilemapCharacter.overlappingTerrainTiles (displace)
Returns tile co-ordinates of all terrain tiles overlapping the character
TilemapCharacter.setDestination (gridCoords)
Set a destination (a tile to move to) for the character.
TilemapCharacter.setRotationOffset (offset)
Calculates the rotations needed for the character
TilemapCharacter.updateAnimation (direction, noMove)
Plays the correct animation depending on the control input state
TilemapCharacter.updateGamepadState ()
Samples the gamepad to get the current states of the buttons and axis
TilemapCharacter.updateVelComponent (noMove, vel, direction)
Adds a direction velocity, taking into account diagonal motion
TilemapCharacter.updateVelocity ()
Updates the velocity and calculates the closest direction for the animation system
TilemapCharacter.velocityToDirection (vel)
Returns the closest movement direction given a provided velocity