## Constructors

- [Animation](/content/docs/Animation/index.html)
- [IsoCharacter](/content/docs/IsoCharacter/index.html)
- [Path](/content/docs/Path/index.html)
- [PhysicsObject](/content/docs/PhysicsObject/index.html)
- [SceneObject](/content/docs/SceneObject/index.html)
- [SceneObjectGroup](/content/docs/SceneObjectGroup/index.html)
- [Sprite](/content/docs/Sprite/index.html)
- [TextSprite](/content/docs/TextSprite/index.html)
- [TilemapCharacter](/content/docs/TilemapCharacter/index.html)
- [wade](/content/docs/wade/index.html)
- [wade.drawFunctions](/content/docs/wade.drawFunctions)
- [wade.iso](/content/docs/wade.iso)
- [wade.physics](/content/docs/wade.physics)
- [wade.tilemap](/content/docs/wade.tilemap)
- [wade.vec2](/content/docs/wade.vec2)

# Fields Summary

**TilemapCharacter._gamepadStates**  
Current state of the gamepad to base movement off

**TilemapCharacter._keyStates**  
Current state of the keys to base movement off

**TilemapCharacter.allowDiagonal**  
Whether or not to allow diagonal movement, true by default

**TilemapCharacter.allowInput**  
A flag that specifies if the character can be controlled by player input

**TilemapCharacter.animations**  
Specify the animation names to use for various walking and idle states

**TilemapCharacter.automaticRotations**  
Automatically rotates object to match movement

**TilemapCharacter.controls**  
Keyboard keys to control the character. By default arrow keys are used

**TilemapCharacter.gamePadControls**  
Axis and direction of gamepad controls

**TilemapCharacter.gamePadIndex**  
The game pad to use

**TilemapCharacter.movementSpeed**  
The movement speed of the character (in world units per second). Note that changing this won't affect any movement that is currently in progress, only future movements. Default is 160.

**TilemapCharacter.name**  
The name of the behavior. This is set to 'TilemapCharacter'.

**TilemapCharacter.rotationOffset**  
Used for automatic rotations. A sprite can have any orientation

**TilemapCharacter.velocity**  
Current velocity of the object

# Functions Summary

**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
