Open Dovyski opened 10 years ago
I don't like this idea, it seems to bloat the code size for no reason at all. Yes, FlxG
is a giant mess, but if you are going to screw over backwards compatibility like this anyway, you might as well create a new FlxInput
class. Personally, I prefer the way HaxeFlixel does it though:
FlxG.keyboard
FlxG.mouse
FlxG.keys
FlxG.touches
FlxG.gamepads
FlxG.android
There are tons of possibilities to clean up FlxG
in other ways (again, see HaxeFlixel).
FlxG
will be fine after the clean up https://github.com/FlixelCommunity/flixel/issues/142.
I wouldn't do FlxG.input
, or do as @Gama11 says FlxInput
.
flixel-gdx https://gi1thub.com/flixel-gdx/flixel-gdx/blob/master/flixel-core/src/org/flixel/FlxG.java
only got two FlxG.mouse
and FlxG.keys
. Mouse
handles also the touches from mobile devices, so you won't need to type FlxG.mouse.justPressed
and FlxG.touch.justPressed
. It works for multi-touch as well.
The Gamepad
is currently a plugin and I think it will stay like that.
When Flixel was created, developers usually focused on a single platform. That's not the case anymore: games are targeting different platforms, e.g. mobile, console, pc, web, etc.
In order to simplify the input handling process, the idea is to create
FlxG.input
. It will be responsible for providing methods to read any type of input, e.g.: