gamepad support and keybind cleaning up
This commit is contained in:
@ -1,5 +1,6 @@
|
||||
package;
|
||||
|
||||
import flixel.input.gamepad.FlxGamepad;
|
||||
import flixel.FlxG;
|
||||
import flixel.FlxSprite;
|
||||
import flixel.addons.transition.FlxTransitionableState;
|
||||
@ -222,12 +223,44 @@ class StoryMenuState extends MusicBeatState
|
||||
{
|
||||
if (!selectedWeek)
|
||||
{
|
||||
if (controls.UP_P)
|
||||
var gamepad:FlxGamepad = FlxG.gamepads.lastActive;
|
||||
|
||||
if (gamepad != null)
|
||||
{
|
||||
if (gamepad.justPressed.DPAD_UP)
|
||||
{
|
||||
changeWeek(-1);
|
||||
}
|
||||
if (gamepad.justPressed.DPAD_DOWN)
|
||||
{
|
||||
changeWeek(1);
|
||||
}
|
||||
|
||||
if (gamepad.pressed.DPAD_RIGHT)
|
||||
rightArrow.animation.play('press')
|
||||
else
|
||||
rightArrow.animation.play('idle');
|
||||
if (gamepad.pressed.DPAD_LEFT)
|
||||
leftArrow.animation.play('press');
|
||||
else
|
||||
leftArrow.animation.play('idle');
|
||||
|
||||
if (gamepad.justPressed.DPAD_RIGHT)
|
||||
{
|
||||
changeDifficulty(1);
|
||||
}
|
||||
if (gamepad.justPressed.DPAD_LEFT)
|
||||
{
|
||||
changeDifficulty(-1);
|
||||
}
|
||||
}
|
||||
|
||||
if (FlxG.keys.justPressed.UP)
|
||||
{
|
||||
changeWeek(-1);
|
||||
}
|
||||
|
||||
if (controls.DOWN_P)
|
||||
if (FlxG.keys.justPressed.DOWN)
|
||||
{
|
||||
changeWeek(1);
|
||||
}
|
||||
|
Reference in New Issue
Block a user