allow gamepad to skip
This commit is contained in:
@@ -5,7 +5,10 @@ import kiss.List;
|
||||
import flixel.FlxG;
|
||||
import flixel.FlxSprite;
|
||||
import flixel.input.actions.FlxAction;
|
||||
import flixel.input.FlxInput;
|
||||
import flixel.input.actions.FlxActionInput;
|
||||
import flixel.input.actions.FlxActionManager;
|
||||
import flixel.input.keyboard.FlxKey;
|
||||
import flixel.input.mouse.FlxMouseButton;
|
||||
import flixel.math.FlxRect;
|
||||
import flixel.group.FlxGroup;
|
||||
@@ -35,7 +38,9 @@ import openfl.display.BitmapData;
|
||||
import openfl.display.BitmapDataChannel;
|
||||
import openfl.geom.Rectangle;
|
||||
import openfl.geom.Point;
|
||||
import flixel.input.mouse.FlxMouseButton;
|
||||
import flixel.input.mouse.FlxMouseEventManager;
|
||||
import flixel.input.gamepad.*;
|
||||
|
||||
@:build(kiss.Kiss.build())
|
||||
class FlxDirector implements Director<FlxSprite, ActorFlxSprite, FlxSound, FlxSound, FlxSprite, FlxSound, FlxCamera, FlxLightSource> {
|
||||
|
@@ -9,17 +9,19 @@
|
||||
(var LAYER_MAX 8)
|
||||
|
||||
(defNew []
|
||||
// Continue action requires fresh input, Fast Forward action supports continuous holding down
|
||||
(set continueAction (new FlxActionDigital "Continue" onContinue))
|
||||
// TODO allow configuring continue keys -- any key, specifically mapped keys, etc.
|
||||
(continueAction.addKey SPACE JUST_PRESSED)
|
||||
(continueAction.addMouse LEFT JUST_PRESSED)
|
||||
(actionManager.addAction continueAction)
|
||||
|
||||
(set fastForwardAction (new FlxActionDigital "Fast Forward"))
|
||||
// TODO allow configuring fast forward keys -- any key, specifically mapped keys, etc.
|
||||
(fastForwardAction.addKey SPACE PRESSED)
|
||||
(fastForwardAction.addMouse LEFT PRESSED)
|
||||
(actionManager.addAction fastForwardAction)
|
||||
// TODO allow configuring continue/fast-forward keys -- any key, specifically mapped keys, etc.
|
||||
(doFor [:FlxActionDigital action :FlxInputState trigger] (zipThrow [continueAction fastForwardAction] [JUST_PRESSED PRESSED])
|
||||
(action.addKey SPACE trigger)
|
||||
(action.addKey ENTER trigger)
|
||||
|
||||
(action.addMouse LEFT trigger)
|
||||
|
||||
(action.addGamepad FlxGamepadInputID.A trigger FlxInputDeviceID.ALL)
|
||||
|
||||
(actionManager.addAction action))
|
||||
|
||||
(FlxG.inputs.add actionManager)
|
||||
(set actionManager.resetOnStateSwitch NONE)
|
||||
|
Reference in New Issue
Block a user