fireatmouse keeps crashing my game (I'm using FlxWeapon)

54 views
Skip to first unread message

CrazyBorg

unread,
Jan 21, 2015, 12:22:42 PM1/21/15
to haxef...@googlegroups.com
So the title pretty much says it all, everything else is working fine. This is in the PlayState class by the way.

Here is my update function
        override public function update():Void 
{
if (FlxG.mouse.pressed)
{
minigun.fireAtMouse();
}
super.update();
}

Here is my create function
        override public function create():Void 
{
minigun = new FlxWeapon("minigun", player);
minigun.makeImageBullet(20, AssetPaths.bullet__png);
FlxG.mouse.useSystemCursor = false;
FlxG.mouse.load(AssetPaths.crosshair__png);
player = new Player(20, 20);
add(player);
super.create();
}
Here is the error code it gives me when I test it in the terminal

Invalid operation (+)
Called from flixel/addons/weapon/FlxBullet.hx line 90
Called from flixel/addons/weapon/FlxWeapon.hx line 364
Called from PlayState.hx line 57
Called from flixel/FlxState.hx line 155
Called from flixel/FlxGame.hx line 700
Called from flixel/FlxGame.hx line 648
Called from flixel/FlxGame.hx line 493
Called from openfl/_v2/events/EventDispatcher.hx line 98
Called from a C function
Called from openfl/_v2/display/DisplayObject.hx line 161
Called from a C function
Called from openfl/_v2/display/DisplayObjectContainer.hx line 280
Called from openfl/_v2/display/Stage.hx line 1041
Called from openfl/_v2/display/Stage.hx line 320
Called from openfl/_v2/display/Stage.hx line 1026
Called from openfl/_v2/display/Stage.hx line 395

I'm using sublime text 2 on mac if that helps at all.

Sebastien V.

unread,
Jan 22, 2015, 12:35:53 AM1/22/15
to
Do the other firing modes work?

CrazyBorg

unread,
Jan 25, 2015, 6:48:22 PM1/25/15
to haxef...@googlegroups.com
Just tested, they don't :(
Reply all
Reply to author
Forward
0 new messages