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 DashAbility
A horizontal dash on
Input#DASH: dashTicks at dashSpeed in the facing
direction with gravity off, then a cooldownTicks wait. In the air it can be
used airDashes times before landing.Fields
public int dashSpeed | Dash speed, fixed point per tick. |
public int dashTicks | Dash length in ticks. |
public int cooldownTicks | Ticks before the next dash. |
public int airDashes | Dashes allowed per jump. |
Constructors
public DashAbility() |
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 isDashing() | Whether a dash is under way. |
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
dashSpeed
public int dashSpeedDash speed, fixed point per tick.
dashTicks
public int dashTicksDash length in ticks.
cooldownTicks
public int cooldownTicksTicks before the next dash.
airDashes
public int airDashesDashes allowed per jump.
Constructor details
DashAbility
public DashAbility()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
isDashing
public boolean isDashing()Whether a dash is under way.
Returns
true mid dash
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.