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
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 walkSpeed | Walking speed, fixed point per tick. |
public int runSpeed | Running speed, fixed point per tick. |
public int crawlSpeed | Speed while crouched. |
public int groundAcceleration | Change of speed per tick on the ground. |
public int groundDeceleration | Change of speed per tick on the ground with no input, the friction. |
public int airAcceleration | Change of speed per tick in the air. |
public boolean canRun | Whether Input#RUN is honoured. |
Constructors
public MoveAbility() |
Methods
public void process(Actor c, PlatformWorld world) | Sets velocity and claims a MovementState. |
Inherited methods
From Ability
isEnabled, setEnabled, earlyProcess, reset, lateProcess, hashState, mix
Field details
walkSpeed
public int walkSpeedWalking speed, fixed point per tick.
runSpeed
public int runSpeedRunning speed, fixed point per tick.
crawlSpeed
public int crawlSpeedSpeed while crouched.
groundAcceleration
public int groundAccelerationChange of speed per tick on the ground.
groundDeceleration
public int groundDecelerationChange of speed per tick on the ground with no input, the friction.
airAcceleration
public int airAccelerationChange of speed per tick in the air.
canRun
public boolean canRunWhether
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
cActor- the actor
worldPlatformWorld- the world