Time for action — updating each object
OnObjectUpdate method, we will control the player machine. For this, we will check if the collision markers are set and act accordingly.
- First, check whether the object is our player object.
If obj = g.player Then
- Next, check that the object is not in some kind of transition. All movements will be made with transitions, so if there aren't any, it stands still.
If obj.GetTransitionCount() = 0 Then
- Set the object to be unanimated for now.
- Check whether the UP arrow key on the keyboard, or the "UP" direction of the joypad on your controller, was pressed. Also check that the player doesn't run into a wall or whether a crate that the player ...