Class WallJumpAbility
java.lang.Object
com.codename1.gaming.platformer.Ability
com.codename1.gaming.platformer.WallJumpAbility
Wall clinging and wall jumping. Falling while pushing into a wall slows the fall
to slideSpeed; jumping from the wall (or within graceTicks of leaving it)
kicks the actor up and away, locking control for lockTicks so the kick
carries before input steers again.
Add it before JumpAbility, which it pre-empts on the wall.
-
Field Summary
FieldsModifier and TypeFieldDescriptionintTicks after leaving a wall that a wall jump still works.intHorizontal kick of a wall jump.intVertical speed of a wall jump.intTicks horizontal control is locked after a wall jump.intFastest fall while clinging, fixed point per tick. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionlonghashState(long h) Mixes the ability's own state into a hash, so two runs that diverge inside an ability are caught.voidlateProcess(Actor c, PlatformWorld world) Runs after the body moved, with the new contacts.voidprocess(Actor c, PlatformWorld world) Sets velocity and claims aMovementState.voidreset()Forgets what the ability was in the middle of, when its actor respawns: a dash, a buffered jump or a grip does not outlive a death.Methods inherited from class Ability
earlyProcess, isEnabled, mix, setEnabled
-
Field Details
-
slideSpeed
public int slideSpeedFastest fall while clinging, fixed point per tick. -
kickX
public int kickXHorizontal kick of a wall jump. -
kickY
public int kickYVertical speed of a wall jump. -
lockTicks
public int lockTicksTicks horizontal control is locked after a wall jump. -
graceTicks
public int graceTicksTicks after leaving a wall that a wall jump still works.
-
-
Constructor Details
-
WallJumpAbility
public WallJumpAbility()
-
-
Method Details
-
process
Description copied from class:AbilitySets velocity and claims a
MovementState.Parameters
c: the actorworld: the world
-
lateProcess
Description copied from class:AbilityRuns after the body moved, with the new contacts.
Parameters
c: the actorworld: the world
- Overrides:
lateProcessin classAbility
-
hashState
-
reset
-