CurrentMovement
Last updated
Last updated
The CurrentMovement property controls the values used by the top down entity in response to input values. This value can be changed according to various conditions in your game such as:
Collision with different terrain (such as walking through mud)
Responding to power-ups (such as collecting a power-up which increases speed)
Responding to special moves or input which changes the character's movement variables (such as holding down a run button)
Movement values can be defined in Glue or code. If your game has a limited set of movement values, these can be defined in Glue. To define a movement value in Glue:
Select the entity
Click the Entity Input Movement tab
Verify that your entity is using the Top Down option for Input Movement Type
Click the Add Control Values button
Modify the newly-added movement values as necessary
The Top Down tab displays all movement values for the selected entity.
You can assign the current movement values in code through the CurrentMovement propety. For example, the following code assigns the movement to FastMovement or Default depending on the state of an Xbox360GamePad: