|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.brackeen.javagamebook.input.GameAction
The GameAction class is an abstract to a user-initiated action, like jumping or moving. GameActions can be mapped to keys or the mouse with the InputManager.
Field Summary | |
static int |
DETECT_INITAL_PRESS_ONLY
Initial press behavior. |
static int |
NORMAL
Normal behavior. |
Constructor Summary | |
GameAction(java.lang.String name)
Create a new GameAction with the NORMAL behavior. |
|
GameAction(java.lang.String name,
int behavior)
Create a new GameAction with the specified behavior. |
Method Summary | |
int |
getAmount()
For keys, this is the number of times the key was pressed since it was last checked. |
java.lang.String |
getName()
Gets the name of this GameAction. |
boolean |
isPressed()
Returns whether the key was pressed or not since last checked. |
void |
press()
Signals that the key was pressed. |
void |
press(int amount)
Signals that the key was pressed a specified number of times, or that the mouse move a spcified distance. |
void |
release()
Signals that the key was released |
void |
reset()
Resets this GameAction so that it appears like it hasn't been pressed. |
void |
tap()
Taps this GameAction. |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final int NORMAL
public static final int DETECT_INITAL_PRESS_ONLY
Constructor Detail |
public GameAction(java.lang.String name)
public GameAction(java.lang.String name, int behavior)
Method Detail |
public java.lang.String getName()
public void reset()
public void tap()
public void press()
public void press(int amount)
public void release()
public boolean isPressed()
public int getAmount()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |