collision detection: custom class and array
so I'm making a top-down shooter for fun, but have been struggling as I'm new to programming,
I have
var player: Player = new Player();
var Enemies: Array = new Array();
now I've been looking all over the net, but this is what I've been trying to work with.
public function checkCollisionWithShip(): void {
for (var e = Enemies.length - 1; e >= 0; e--) {
if (Enemies
trace(Enemies
Lives -= 1;
updateUI();
trace("ship collision!");
}
}
}
However, everytime my ship(player) touches an enemy, nothing ever happens.
looking forward to your replies,
thanks a lot for your time.
