Modifier and Type | Field and Description |
---|---|
static int |
DIRECTION_LEFT |
static int |
DIRECTION_RIGHT |
Constructor and Description |
---|
MoveHorizontal(int direction)
creates a new command for moving horizontally in the indicated direction
|
Modifier and Type | Method and Description |
---|---|
void |
execute(GameObject actor)
make the object move in a direction according to its speed
|
void |
exit(GameObject actor)
make an object stop to move by setting its velocity to zero
|
public static int DIRECTION_LEFT
public static int DIRECTION_RIGHT
public MoveHorizontal(int direction)
direction
- the direction to move in, use DIRECTION_LEFT and DIRECTION_RIGHTpublic void execute(GameObject actor)
public void exit(GameObject actor)