Hi guys my code for collision detection is as follows i need it to loop through 55 pictures on the main form //aliens are named alien1, alien2 ect //image2 is the collison object ( the bullet)
CODE IS TURBO DELPHI
procedure TForm1.TimeralienshotTimer(Sender: TObject)
var
ax2 : integer;
bx2 : integer;
ay2 : integer;
by2 : integer;
alienX : array[1..55] of integer;
alienY : array[1..55] of integer;
Index: Integer;
begin
for index := 1 to 55 do
alienX[index]:= alien([index]).left <--- the problem is this code here !!!!
ax2 := alienX + 21;
bx2 := Image2.left + 10;
ay2 := AlienY + 25;
by2 := Image2.top + 24;
if ax2 >= alienX then
if alienX <= bx2 then
if ay2 >= image2.top then
if alienY <= by2 then
begin
alien[index].Visible := false;
Image2.top := 875;
Image2.left := 648;
Timershotmovment.Enabled := false;
end;
end;