This is my collision procedure:
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);
if (enemy.hit)then
begin
FormGame.DXWaveList.Items.Find('Explode').Play(false);
Enemy := TEnemy.create(dxspriteEngine.Engine);
end;
end;
end
else
Bookmarks