Construct a JumpBehavior
OptionalallowMultiJump?: booleanTrue if the actor can jump infinitely often while airborne
OptionalnumJumpsAllowed?: numberUse 2 to enable double-jumps, etc.
Optionalteam?: numberThe team this actor belongs to (default 0)
Protected Optional_The actor associated with this Behavior
Indicate that the actor can jump infinitely often while in the air
Which "team" this Behavior belongs to. A team is just a number, and for
the most part it's only when user code consults teams that teams have
meaning. The only exception is that HazardBehavior uses team to prevent
team attack damage.
The actor associated with this Behavior
How many jumps have been made since the actor was last on the ground
How many jumps the actor gets before it needs to touch the ground again (always at least 1). This can change after the actor is built, e.g., when the actor picks up a power-up that grants a double jump.
Set how many jumps the actor gets before touching the ground (values below 1 become 1)
Indicate that this Behavior should ignore collisions with some other property
ProtecteddisableTurn off physical collisions for actor. Used by Behaviors that are only
ever passed through, not physically collided with, like coins.
The actor being attached (may be undefined, if this Behavior is being detached)
Make the actor jump, unless it is in the air and out of jumps, or it is crawling
ProtectedrequireIf actor's body isn't dynamic, warn and upgrade it to dynamic. Used
by every Behavior whose whole point requires a dynamic body (e.g.
setVelocity/forces actually doing something).
The actor being attached (may be undefined, if this Behavior is being detached)
The name to use in the warning message
Called (typically by a SolidBehavior this actor lands on) to indicate the actor is back on solid ground and can jump again.
JumpBehavior grants an actor the ability to jump. Jumping is not just "moving upward", because: