HP help

Trapper74Trapper74 Member Posts: 45
edited November -1 in Working with GS (Mac)
ok so in my scene i have 4 targets or bases that are under attack, they only require one hit to destroy them which is fine but i want the game to show the 'game over' screen only when all the bases have been destroyed.

currently i have a global integer named 'Global Base HP' with a value of 4 (1hp per base, complete guess that this would work lol)

then in the 4 'base' actors i have a hitpoints integer set to 1 (1hp) and a Change Attribute set:

game.Global Base HP -TO- self.hitpoints-1

i then created an invisible actor called 'end' and set the rule to:

when game.Global Base HP = 0

Change scene to Game Over

needless to say it doesn't work lol, any ideas on how i might go about this?

thanks

Comments

  • EastboundEastbound Member, BASIC Posts: 1,074
    I think your problem is this line: game.Global Base HP -TO- self.hitpoints-1

    I don't know what value self.hitpoints is, but it would likely be different for the different bases. If I understood you correctly, this should fix it:

    Set game.GlobalBaseHP = game.GlobalBaseHP - 1
  • Trapper74Trapper74 Member Posts: 45
    ok i tried adding that on all 4 base actors but it still isnt working,

    if it helps at all the nearest real game i can think of that this is like is missile command from years ago, i just need when all bases r destroyed go to game over, weather its done the way i was trying or not lol
  • Trapper74Trapper74 Member Posts: 45
    anyone have any more ideas?
Sign In or Register to comment.