Hi, the demo uses player.drawDebug(), but you have player.path.drawDebug(). Maybe that changes things? I havent tried myself, hope it helps.
Posts made by nekomasterdeluxe
RE: Dealing with save files?
Thank you for replying. I figured out the problem, it was a two part:
- Correctly check if there's data already on the Flxsave slot (that was pretty dumb on my part, i skipped that).
- You can't push a class into the save file like this:
That gave me a trace overflow issue in flashdevelop, so i figured:
_save.data.MyVar.push( Type.getClassName(Type.getClass(MyClass)) );
Works fine because it stores it as a string. When loading you can get you class by doing Type.resolveClass().
That resolves the issue, hopefully it helps someone in the future. It wasnt clearly documented in the haxeflixel docs.
Thanks again for replying.
Dealing with save files?
I'm trying to make a save that works beetwen sessions, but when I close and then open my game again, it doesnt load the old save data (using Flxsave).
To maintain data between sessions, do you guys write to a file using Sys.io.File or use Flxsave? Maybe I'm doing something wrong.
RE: Collision and overlap in a tilemap problem.
Thank you for the quick reply man, sorry i cant put more links or code, im being flagged spammer when i try, lol.
I thought i added enemies here:
var enemies = new FlxTypedGroup<Enemy>(); _enemy = enemies.recycle(Enemy); _enemy.setPosition(_spawner.getPosition().x, _spawner.getPosition().y); add(_enemy);
Collision and overlap in a tilemap problem.
Hi, im new to haxeflixel ( and programming mostly) and im stuck with a problem in a TD game im trying to create.
Im trying to spawn enemies from _spawn, find a path to _player, and get killed once they touch _player. Up to this point, eveything was fine, but when i added a tilemap flxg.overlap and flxg.collide either don't work, or break the tilemap.
I've noticed overlap gets called every frame, so it's checking collision with the map itself i believe, not with the Player entity.The .kill() method is also breaking it in other version of this same problem (calling a die function in the Enemy class, wich is just super.kill();).
So my question is, how do i check for collision between _enemy (wich comes from a group) and _player in my situation? Is there a simple answer that im missing?
Thank you for reading my problem guys.