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
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 climbSpeed | Climbing 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
From Ability
Field details
climbSpeed
public int climbSpeedClimbing 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
cActor- the actor
worldPlatformWorld- the world
lateProcess
public void lateProcess(Actor c, PlatformWorld world)Runs after the body moved, with the new contacts.
Parameters
cActor- the actor
worldPlatformWorld- 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
hlong- 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.