Hello again fellow coders. I've been having some issues with this class while I follow along this tutorial :
http://haxeflixel.com/documentation/part-viii-enemies-and-basic-ai/. I've spent a good amount of time between yesterday and today trying to get to the bottom of it, but I fear that my little knowledge of Haxe, although increasing, limits me somewhat. Thankfully, I've a workaround in place that suits me well. But if I want to know how to use this class correctly, I need to know what's wrong with my code. Or if it's perhaps not my code but Ogmo Editor trolling me somehow. First, here is my issue, a stacktrace:
Invalid field access : allowCollisions
Called from flixel/tile/FlxTilemap.hx line 1357
Called from PlayState.hx line 115
Called from flixel/group/FlxTypedGroup.hx line 651
Called from PlayState.hx line 92
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/_legacy/events/EventDispatcher.hx line 98
Called from openfl/_legacy/display/DisplayObject.hx line 182
Called from openfl/_legacy/display/DisplayObject.hx line 161
Called from openfl/_legacy/display/DisplayObjectContainer.hx line 280
Called from openfl/_legacy/display/Stage.hx line 1098
Called from openfl/_legacy/display/Stage.hx line 351
Called from openfl/_legacy/display/Stage.hx line 1079
Called from openfl/_legacy/display/Stage.hx line 430
Playstate.hx line 115 is:
if (_mWalls.ray(e.getMidpoint(), _player.getMidpoint()))
Playstate.hx line 92 is:
_grpEnemies.forEachAlive(checkEnemyVision);
The context of what's happening is, once I test the project out it either A) Crashes immediately, or B) Crashes just a few seconds in. If I eliminate a few enemy entities from the level using Ogmo, and just place one entity, the project does not crash immediately. Im able to move around, if the enemy has line of sight, he will head towards me. If I escape, he stops following and just goes back to moping around. After a while though, the game crashes again and gives me that invalid field access. Im not sure if the checkEnemyVision function is crashing my game as the raycast hits a wall, if its Ogmo and it's entities or if it's something else. I've attached my playstate.hx code. Followed along the tutorial.