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 LadderAbility

  1. Object
  2. Ability
  3. LadderAbility

Climbing Tile#LADDER cells. Up or down while overlapping a ladder grabs it: gravity stops, the actor centres on the ladder and moves at climbSpeed. Jumping lets go (JumpAbility treats a ladder as ground), as does climbing off either end. Standing on top of a ladder and holding down climbs down through it.

Add it before JumpAbility so a jump from the ladder sees the climbing state.

Fields

public int climbSpeedClimbing speed, fixed point per tick.

Constructors

public LadderAbility()

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 boolean isClimbing()Whether the actor is on a ladder.
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

climbSpeed

public int climbSpeed
Climbing speed, fixed point per tick.

Constructor details

LadderAbility

public LadderAbility()

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

isClimbing

public boolean isClimbing()
Whether the actor is on a ladder.

Returns

true while climbing

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.