You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
33 lines
1.2 KiB
33 lines
1.2 KiB
package sig.engine;
|
|
|
|
import java.awt.event.KeyEvent;
|
|
import java.util.ArrayList;
|
|
import java.util.Arrays;
|
|
|
|
import net.java.games.input.Component.Identifier;
|
|
|
|
public enum Action {
|
|
MOVE_RIGHT(new KeyBind(KeyEvent.VK_RIGHT),new KeyBind(KeyEvent.VK_D)),
|
|
MOVE_LEFT(new KeyBind(KeyEvent.VK_LEFT),new KeyBind(KeyEvent.VK_A)),
|
|
JUMP(new KeyBind(KeyEvent.VK_SPACE),new KeyBind(KeyEvent.VK_W),new KeyBind(KeyEvent.VK_UP)),
|
|
FALL(new KeyBind(KeyEvent.VK_DOWN),new KeyBind(KeyEvent.VK_S)),
|
|
ATTACK(new KeyBind(KeyEvent.VK_Z)),
|
|
SLIDE(new KeyBind(KeyEvent.VK_CONTROL)),
|
|
LEVEL_EDITOR(new KeyBind(KeyEvent.VK_F2)),
|
|
PLAY_GAME(new KeyBind(KeyEvent.VK_F1)),
|
|
EDITOR_SET_VIEW(new KeyBind(KeyEvent.VK_F3)),
|
|
EDITOR_SET_TYPE(new KeyBind(KeyEvent.VK_F4)),
|
|
EDITOR_SET_BACKGROUND(new KeyBind(KeyEvent.VK_F5)),;
|
|
|
|
float val;
|
|
Key controllingKey;
|
|
|
|
Action(KeyBind...keybinds) {
|
|
KeyBind.KEYBINDS.put(this,new ArrayList<>(Arrays.asList(keybinds)));
|
|
}
|
|
Action(byte port, Identifier.Axis axis,float val) {
|
|
ArrayList<KeyBind> comps = new ArrayList<KeyBind>();
|
|
comps.add(new KeyBind(port,axis,val));
|
|
KeyBind.KEYBINDS.put(this,comps);
|
|
}
|
|
}
|
|
|