Package hoverball
Class Human.Controls
java.lang.Object
hoverball.Human.Controls
- Enclosing class:
- Human
public static class Human.Controls
extends java.lang.Object
The class Human.Controls defines controls for Human units.
For now, only key controls are possible.
-
Field Summary
Fields Modifier and Type Field Description static Human.Controls
CRSR
Default key controls: cursor keys + control + shift -
Constructor Summary
-
Method Summary
Modifier and Type Method Description java.lang.String
getKeyText(int control)
Returns a string representation of each key controls.
-
Field Details
-
CRSR
Default key controls: cursor keys + control + shift
-
-
Constructor Details
-
Controls
public Controls(int forward, int back, int left, int right, int positive, int negative)Defines a key controls.The arguments correspond to the KeyEvent codes.
- Parameters:
forward
- move forwardback
- move backwardleft
- turn leftright
- turn rightpositive
- polarize positivenegative
- polarize negative
-
Controls
public Controls(java.lang.String controls)Defines a key controls.The first 6 characters of the controls string define the keys for:
- move forward
- move backward
- turn left
- turn right
- polarize positive
- polarize negative
- Parameters:
controls
- controls string
-
-
Method Details
-
getKeyText
public java.lang.String getKeyText(int control)Returns a string representation of each key controls.The argument
control
means:- 0 = move forward
- 1 = move backward
- 2 = turn left
- 3 = turn right
- 4 = polarize positive
- 5 = polarize negative
- Parameters:
control
- required controls
-