Skip to content

Commit

Permalink
Mode: fix mobile input
Browse files Browse the repository at this point in the history
  • Loading branch information
Gama11 committed May 16, 2014
1 parent 528030e commit 17dc470
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
4 changes: 2 additions & 2 deletions Platformers/Mode/Project.xml
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,9 @@
<!--haxedef name="FLX_NO_NATIVE_CURSOR" /-->

<!--Optimise inputs, be careful you will get null errors if you don't use conditionals in your game-->
<!--haxedef name="FLX_NO_MOUSE" if="mobile" /-->
<haxedef name="FLX_NO_MOUSE" if="mobile" />
<!--haxedef name="FLX_NO_KEYBOARD" if="mobile" /-->
<!--haxedef name="FLX_NO_TOUCH" if="desktop" /-->
<haxedef name="FLX_NO_TOUCH" if="desktop" />
<!--haxedef name="FLX_NO_GAMEPAD" /-->

<!--Disable the Flixel core sound tray-->
Expand Down
14 changes: 7 additions & 7 deletions Platformers/Mode/source/Player.hx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import flixel.ui.FlxVirtualPad;
import flixel.util.FlxDestroyUtil;
import flixel.util.FlxSpriteUtil;
import flixel.util.FlxTimer;
#if (android && OUYA)
#if android
import flixel.input.gamepad.OUYAButtonID;
#end

Expand Down Expand Up @@ -136,7 +136,7 @@ class Player extends FlxSprite
if (FlxG.keys.pressed.LEFT
#if !FLX_NO_GAMEPAD
|| (#if flash gamepad.pressed(XboxButtonID.DPAD_LEFT) #else gamepad.dpadLeft #end ||
#if OUYA
#if android
gamepad.getXAxis(OUYAButtonID.LEFT_ANALOGUE_X) < 0) || buttonPressed(virtualPad.buttonLeft))
#else
gamepad.getXAxis(XboxButtonID.LEFT_ANALOGUE_X) < 0))
Expand All @@ -148,7 +148,7 @@ class Player extends FlxSprite
else if (FlxG.keys.pressed.RIGHT
#if !FLX_NO_GAMEPAD
|| (#if flash gamepad.pressed(XboxButtonID.DPAD_RIGHT) #else gamepad.dpadRight #end ||
#if OUYA
#if android
gamepad.getXAxis(OUYAButtonID.LEFT_ANALOGUE_X) > 0) || buttonPressed(virtualPad.buttonRight))
#else
gamepad.getXAxis(XboxButtonID.LEFT_ANALOGUE_X) > 0))
Expand All @@ -164,7 +164,7 @@ class Player extends FlxSprite
if (FlxG.keys.pressed.UP
#if !FLX_NO_GAMEPAD
|| (#if flash gamepad.pressed(XboxButtonID.DPAD_UP) #else gamepad.dpadUp #end ||
#if OUYA
#if android
gamepad.getYAxis(OUYAButtonID.LEFT_ANALOGUE_Y) < 0) || buttonPressed(virtualPad.buttonUp))
#else
gamepad.getYAxis(XboxButtonID.LEFT_ANALOGUE_Y) < 0))
Expand All @@ -176,7 +176,7 @@ class Player extends FlxSprite
else if (FlxG.keys.pressed.DOWN
#if !FLX_NO_GAMEPAD
|| (#if flash gamepad.pressed(XboxButtonID.DPAD_DOWN) #else gamepad.dpadDown #end ||
#if OUYA
#if android
gamepad.getYAxis(OUYAButtonID.LEFT_ANALOGUE_Y) > 0) || buttonPressed(virtualPad.buttonDown))
#else
gamepad.getYAxis(XboxButtonID.LEFT_ANALOGUE_Y) > 0))
Expand All @@ -189,7 +189,7 @@ class Player extends FlxSprite
// JUMPING
if (FlxG.keys.justPressed.X
#if !FLX_NO_GAMEPAD
#if OUYA
#if android
|| gamepad.justPressed(OUYAButtonID.O) || buttonPressed(virtualPad.buttonA))
#else
|| gamepad.justPressed(XboxButtonID.A))
Expand Down Expand Up @@ -241,7 +241,7 @@ class Player extends FlxSprite
// SHOOTING
if (FlxG.keys.pressed.C
#if !FLX_NO_GAMEPAD
#if OUYA
#if android
|| gamepad.pressed(OUYAButtonID.U) || buttonPressed(virtualPad.buttonB))
#else
|| gamepad.pressed(XboxButtonID.X))
Expand Down

0 comments on commit 17dc470

Please sign in to comment.