Help Request with flxcontrol

24 views
Skip to first unread message

YLJY

unread,
Sep 22, 2015, 11:31:23 PM9/22/15
to HaxeFlixel
Hi guys, another question again.

I am playing with the flxcontrol for the first time, and encountered a lot of problems, here is my code : 

class PlayState extends FlxState
{
private var _player:FlxSprite;

override public function create():Void
{
//add player
_player = new FlxSprite(64,150);
_player.makeGraphic(16,16,FlxColor.BLUE);
_player.width = 16;
_player.height = 16;
//movement for the player
FlxControl.create(_player,FlxControlHandler.MOVEMENT_INSTANT,FlxControlHandler.STOPPING_INSTANT,1);
FlxControl.player1.setCursorControl(true,false,true,true);
FlxControl.player1.setStandardSpeed(100, false);
add(_player);
super.create();
}

everthing compiles, but the player does not move, no matter how much I tried, I have opened the test suite for the power tools, and copied what was there,still, no luck...

help will be appreciated very much.

Thank you!


Gama11

unread,
Sep 23, 2015, 3:16:41 AM9/23/15
to haxef...@googlegroups.com
Not a fan of FlxControl personally... It might be convenient in some niche scenarios, but it seems very restrictive / inflexible as soon as you want to do something slightly different. And implementing controls / input yourself in update() really doesn't take too many lines of code.

Sorry this doesn't really address your problem, but I can't check the code right now. :)

SruloArt

unread,
Sep 23, 2015, 1:13:24 PM9/23/15
to haxef...@googlegroups.com
* I agree with Gama11, FlxControl should be replaced with something better.
* But I think you just didn't add it to your plugins (talking about another thing that should be replaced):

if (FlxG.getPlugin(FlxControl) == null) { FlxG.addPlugin(new FlxControl()); }
Reply all
Reply to author
Forward
0 new messages