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 LookAbility
Looking up and down: holding up, or down, while standing still for
delayTicks
sets a look direction that a camera pans by (see getLook()).Fields
public int delayTicks | Ticks of holding before the camera pans. |
Constructors
public LookAbility() |
Methods
public void process(Actor c, PlatformWorld world) | Sets velocity and claims a MovementState. |
public int getLook() | The look direction: -1 up, 1 down, 0 neither. |
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
delayTicks
public int delayTicksTicks of holding before the camera pans.
Constructor details
LookAbility
public LookAbility()Method details
process
public void process(Actor c, PlatformWorld world)Sets velocity and claims a
MovementState.Parameters
cActor- the actor
worldPlatformWorld- the world
getLook
public int getLook()The look direction: -1 up, 1 down, 0 neither.
Returns
the direction
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.