Move an entity left or right using the
Right Arrow keys or
and make it jump using
Up Arrow or
Simulates jumping and falling when used with the
This component is a thin wrapper around the
Jumper components and sets the appropriate key bindings.
It is a well suited for side-scrolling platformer type games.
public this .twoway([Number speed[, Number jumpSpeed]])
A speed in pixels per second
Vertical jump speed in pixels per second
Constructor to initialize the speed and power of jump. Component will listen for key events and move the entity in the respective direction by the speed passed in the argument. Pressing the jump key will cause the entity to jump with the supplied power.