Thanks for the replies guys.
Code:
procedure TFormGame.BulletCollision(Sender:TObject;var done:Boolean);
begin
if (sender is TEnemy) then
begin
Enemy := TEnemy(sender);
if (not Enemy.Hit) then
begin
Explode := TExplode.Create(dxSpriteEngine.Engine);
Explode.X := Enemy.X;
Explode.Y := Enemy.Y;
Enemy.hit := true;
Enemy.Dead; <---------------
Bullet.Dead;
Inc(Points,100);
Inc(EnemyCount,1);
[b] if (enemy.hit)then <---------// Should it be if (enemy.deaded)?[/b] begin
FormGame.DXWaveList.Items.Find('Explode').Play(false);
Enemy := TEnemy.create(dxspriteEngine.Engine);
end;
end;
end
else
Or should it be :
Code:
Enemy.Dead; <---------------
Bullet.Dead;
Inc(Points,100);
Inc(EnemyCount,1);
FormGame.DXWaveList.Items.Find('Explode').Play(false);
Enemy := TEnemy.create(dxspriteEngine.Engine);
Bookmarks