Package struct
Class Key
java.lang.Object
struct.Key
The class dealing with all possible keys used in the game.
-
Field Summary
Modifier and TypeFieldDescriptionboolean
If the value is set to true, then the "A" button will be pressed.boolean
If the value is set to true, then the "B" button will be pressed.boolean
If the value is set to true, then the "C" button will be pressed.boolean
If the value is set to true, then the "Down" button will be pressed.boolean
If the value is set to true, then the "Left" button will be pressed.boolean
If the value is set to true, then the "Right" button will be pressed.boolean
If the value is set to true, then the "Up" button will be pressed. -
Method Summary
-
Field Details
-
A
public boolean AIf the value is set to true, then the "A" button will be pressed. -
B
public boolean BIf the value is set to true, then the "B" button will be pressed. -
C
public boolean CIf the value is set to true, then the "C" button will be pressed. -
U
public boolean UIf the value is set to true, then the "Up" button will be pressed. -
R
public boolean RIf the value is set to true, then the "Right" button will be pressed. -
D
public boolean DIf the value is set to true, then the "Down" button will be pressed. -
L
public boolean LIf the value is set to true, then the "Left" button will be pressed.
-
-
Method Details
-
empty
public void empty()Resets all keys to false, or not pressed. -
isEmpty
public boolean isEmpty()Returns the flag whether or not the key is being pressed.- Returns:
true
if no key is being pressed,false
otherwise
-
getLever
public int getLever(boolean isFront) Returns the value indicating the direction key input by the player using the numeric keypad.- Parameters:
isFront
- the boolean value representing the player's orientation- Returns:
- the direction value from the numeric keypad
-