EditMake an actor jump
Basic Idea: Use the handy shortcut "run and jump by pressing keys (side view)". See notes below if you want to create this behavior from scratch.
Sample:
http://www.popfly.com/users/team/HowDoI-JumpDetails:
- Make sure the actor has a solid object to stand on. Other wise, actor will sink into the underground!
- Click on the actor, then Behavior, and then select "run and jump by pressing keys (side view)" shortcut available at the top right of the Behavior dialog
 Jump (Click on the image for full size) |
Details:
Defining a jump action requires a few steps.
- Assign gravity: Create a down motion for the actor that starts at the game start and continues forever.
- Change YDrag property of the actor to a small value, for example 0.3.
 Define YDrag |
- Define jump motion: Create an UP motion for the actor that uses 'Jump Velocity' value. Make sure you assign jump motion to key PRESS (default is WHILE KEY DOWN)
 Jump (Click on the image for full size) |