Client and backend. This class is shared: the same code is compiled into your app and into your server, so everything on this page works in both.

public class WallJumpAbility

  1. Object
  2. Ability
  3. 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.

Fields

public int slideSpeedFastest fall while clinging, fixed point per tick.
public int kickXHorizontal kick of a wall jump.
public int kickYVertical speed of a wall jump.
public int lockTicksTicks horizontal control is locked after a wall jump.
public int graceTicksTicks after leaving a wall that a wall jump still works.

Constructors

public WallJumpAbility()

Methods

public void process(Actor c, PlatformWorld world)Sets velocity and claims a MovementState.
public void lateProcess(Actor c, PlatformWorld world)Runs after the body moved, with the new contacts.
public long hashState(long h)Mixes the ability’s own state into a hash, so two runs that diverge inside an ability are caught.
public void reset()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.

Inherited methods

Field details

slideSpeed

public int slideSpeed
Fastest fall while clinging, fixed point per tick.

kickX

public int kickX
Horizontal kick of a wall jump.

kickY

public int kickY
Vertical speed of a wall jump.

lockTicks

public int lockTicks
Ticks horizontal control is locked after a wall jump.

graceTicks

public int graceTicks
Ticks after leaving a wall that a wall jump still works.

Constructor details

WallJumpAbility

public WallJumpAbility()

Method details

process

public void process(Actor c, PlatformWorld world)
Sets velocity and claims a MovementState.

Parameters

c Actor
the actor
world PlatformWorld
the world

lateProcess

public void lateProcess(Actor c, PlatformWorld world)
Runs after the body moved, with the new contacts.

Parameters

c Actor
the actor
world PlatformWorld
the world

hashState

public long hashState(long h)
Mixes the ability’s own state into a hash, so two runs that diverge inside an ability are caught. The default mixes nothing.

Parameters

h long
the running hash

Returns

the updated hash

reset

public void reset()
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. The default does nothing; an ability with per-run state overrides it.