-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathAction.hx
39 lines (31 loc) · 1.25 KB
/
Action.hx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
import flixel.addons.input.FlxControls;
import flixel.addons.input.FlxControlInputType;
import flixel.input.keyboard.FlxKey;
import flixel.input.gamepad.FlxGamepadInputID;
enum Action
{
/** Moves the player up, also used to navigate menus */
@:inputs([FlxKey.UP, FlxKey.W, DPAD_UP, LEFT_STICK_DIGITAL_UP, FlxVirtualPadInputID.UP])
UP;
/** Moves the player down, also used to navigate menus */
@:inputs([FlxKey.DOWN, FlxKey.S, DPAD_DOWN, LEFT_STICK_DIGITAL_DOWN, FlxVirtualPadInputID.DOWN])
DOWN;
/** Moves the player left, also used to navigate menus */
@:inputs([FlxKey.LEFT, FlxKey.A, DPAD_LEFT, LEFT_STICK_DIGITAL_LEFT, FlxVirtualPadInputID.LEFT])
LEFT;
/** Moves the player right, also used to navigate menus */
@:inputs([FlxKey.RIGHT, FlxKey.D, DPAD_RIGHT, LEFT_STICK_DIGITAL_RIGHT, FlxVirtualPadInputID.RIGHT])
RIGHT;
/** Allows for smooth movement */
@:inputs([LEFT_ANALOG_STICK, Mouse(Motion())]) @:analog(x, y)
MOVE;
/** Doesn't do anything, but their values are exposed in the analog visualizer */
@:inputs([LEFT_TRIGGER])
@:analog(value)
TRIGGER_LEFT;
/** Doesn't do anything, but their values are exposed in the analog visualizer */
@:inputs([RIGHT_TRIGGER])
@:analog(value)
TRIGGER_RIGHT;
}
class Controls extends FlxControls<Action> {}