just a simple questin that i have yet to figure out. i feel close, but run into problem of it not working.
but i have an array of bullets, or could even be enemies, sand etc
private var _bullet:Array<Bullet>;
private function setupBullet():Void{
// TODO: maybe put in bullet spawn here instead. easier to have collision and deletion
_bullet = [];
var bullets:Bullet = new Bullet();
bullets.x = _player.x + 32;
bullets.y = _player.y + 12;
addChild(bullets);
_bullet.push(bullets);
if (bullets.x >= 500) {
removeChild(bullets);
_bullet.remove(bullets);
}
}
and whilst the creation is absolutely fine. it creates bodies through keyDown and using update. but do want a bullet/sand/enemy to be able to delete/remove itself either from being touched by something else, or by reaching the end of the screen. the bottom of the code posted is what i got to before i had to call a friend and ask about it
EDIT
AWESOME BALLS. works now. still can see that i really need to not do other work and just be on haxe/openfl
even a few days away makes it looks like greek