Wednesday, October 04, 2006

Terrorist's movements

Here is the random event for the terrorist's movements:

RdmEvent:=random(12); // Random event calculation
if RdmEvent=0 then begin // Terrorist movement to the right
case TerroristPos
of 3: begin TerroristPos:=4; ImageTerrorist4.Visible:=true; ImageTerrorist3.visible:=false; end;
2: begin TerroristPos:=3; ImageTerrorist3.Visible:=true; ImageTerrorist2.visible:=false; end;
1: begin TerroristPos:=2; ImageTerrorist2.Visible:=true; ImageTerrorist1.visible:=false; end;
end;
end;
if RdmEvent=1 then begin // Terrorist movement to the left
case TerroristPos
of 2: begin TerroristPos:=1; ImageTerrorist1.Visible:=true; ImageTerrorist2.visible:=false; end;
3: begin TerroristPos:=2; ImageTerrorist2.Visible:=true; ImageTerrorist3.visible:=false; end;
4: begin TerroristPos:=3; ImageTerrorist3.Visible:=true; ImageTerrorist4.visible:=false; end;
end;
end;


No comments: