Hi everyone, can anyone help me. I want my player to have shields i.e. only after 10 bombs has hit my player the player should die and a new player should be created. At the moment my player has three lives and when a bomb hits it the lives are decreased untill zero.

I played around with the shields in my code and also tried it in the TBomb.DoCollision procedure but it has no effect.

Thanks for a GREAT site :-)



[pascal]procedure TForm1.PlayerShield;
begin
if form1.DXImageList1.Items.Find('fireball') = form1.DXImageList1.Items.Find('player') then
Player_Shields := form1.Player_Shields - 10;
if (form1.player_Shields = 0) then
player.Dead;
end;


procedure TForm1.StartMain;
begin
Splash;
Randomize;
EnimyCreate;
AttackerCreate;
PlayerCreate;
Player_Shields := 100;
PlayerShield;
BackGroundCreate;
Earthy := DXDraw1.Height - 500;
Earthx := DXDraw1.Width - 350;
Planetx := DXDraw1.Width - 700;
Planety := DXDraw1.Height -600;
PlanetStrangeX := DXDraw1.Width - 1000;
PlanetStrangeY :=DXDraw1.Height - 475;
Disk_Start_No := 1;
Disk_End_No := 1;
NewDisk;
SpaceShipDown_Start_No := 1;
SpaceShipDown_End_No := 1;
NewSpaceShipDown;
Lives := 3;
Points := 0;
SpaceMines := 0;
SpaceMines := 0;
end;


procedure TBomb.DoCollision(Sprite: TSprite; var Done: Boolean);
begin
If (Sprite is TPlayer) Then
begin
Sprite.Collisioned := False;
Sprite.Dead;
Dead;
Done := False;
end;
end;[/pascal]