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

  1. Object
  2. Ability
  3. 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 dashSpeedDash speed, fixed point per tick.
public int dashTicksDash length in ticks.
public int cooldownTicksTicks before the next dash.
public int airDashesDashes 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

Field details

dashSpeed

public int dashSpeed
Dash speed, fixed point per tick.

dashTicks

public int dashTicks
Dash length in ticks.

cooldownTicks

public int cooldownTicks
Ticks before the next dash.

airDashes

public int airDashes
Dashes 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

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

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

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.