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 MoveAbility

  1. Object
  2. Ability
  3. MoveAbility
Horizontal movement: walking, running while Input#RUN is held, crawling while crouched, with separate acceleration on the ground and in the air.

Fields

public int walkSpeedWalking speed, fixed point per tick.
public int runSpeedRunning speed, fixed point per tick.
public int crawlSpeedSpeed while crouched.
public int groundAccelerationChange of speed per tick on the ground.
public int groundDecelerationChange of speed per tick on the ground with no input, the friction.
public int airAccelerationChange of speed per tick in the air.
public boolean canRunWhether Input#RUN is honoured.

Constructors

public MoveAbility()

Methods

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

Inherited methods

Field details

walkSpeed

public int walkSpeed
Walking speed, fixed point per tick.

runSpeed

public int runSpeed
Running speed, fixed point per tick.

crawlSpeed

public int crawlSpeed
Speed while crouched.

groundAcceleration

public int groundAcceleration
Change of speed per tick on the ground.

groundDeceleration

public int groundDeceleration
Change of speed per tick on the ground with no input, the friction.

airAcceleration

public int airAcceleration
Change of speed per tick in the air.

canRun

public boolean canRun
Whether Input#RUN is honoured.

Constructor details

MoveAbility

public MoveAbility()

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