Detect Number of Animies and Game Over

creativeappscreativeapps Member Posts: 1,770
edited November -1 in Working with GS (Mac)
In my game I have car(user) and petrol tank(enemy ) when car collide with tank after 1-2 seconds I am showing level complete screen. But in few levels I have 2-3 petrol tanks.
And that time when car collide with 1 pertrol tank its showing game over screen still 2 more petrol tank is stady. How do I setup that after collide and destroy all 3 tanks its showing level complete screen. In each level I have dynamic petrol tanks. Please help me out.

Comments

  • creativeappscreativeapps Member Posts: 1,770
    anyone please?
  • rlehmrlehm Member Posts: 320
    Make an attribute gas (integer)

    in each level
    game.gas = # of gas

    rule
    collide with gas
    gas = gas-1
    otherwise
    spawn game over
    (or interpolate alpha or whatever)

    instead of otherwise you could
    if game.gas=0
    spawn game over

    also, please wait more than 20 minutes to bump a post. Wait like a day or so.
  • RHRH Member Posts: 1,079
    rlehm said:

    also, please wait more than 20 minutes to bump a post. Wait like a day or so.

    or at least until it is off the main page.

    Another way you could do it, if you didn't want to unlock any instances is to put a change attribute: game.gas to game.gas+1 on the prototype for the petrol tank

    then have a rule on the car when overlaps or collides with petrol tank
    change attribute:game.gas to game.gas-1

    [you'll have to put the next rule in a very short timer if the actor it is on is layered below the petrol tanks]
    rule on any actor that when game.gas = 0
    level complete behaviours
  • rlehmrlehm Member Posts: 320
    RH, I like your thinking. That's awesome.
  • creativeappscreativeapps Member Posts: 1,770
    I am using pause behaviour for level complete screen. So After collision level complete screen overlap on playing screen. I am getting confused. Will you please explain me in more details.
    Thanks
  • creativeappscreativeapps Member Posts: 1,770
    hello?
  • rlehmrlehm Member Posts: 320
    Why are you spawning a level complete screen and a pause screen?
  • creativeappscreativeapps Member Posts: 1,770
    Beacuse I have around 60-70 levels
  • creativeappscreativeapps Member Posts: 1,770
    Do you want to check my template? I can show you
  • rlehmrlehm Member Posts: 320
    If you spawn pause and level complete and this is an issue, spawn only one of them?
  • creativeappscreativeapps Member Posts: 1,770
    No I dont understand what you said in your first post. please explain me step by step. Thanks
  • RedlerTechRedlerTech Member Posts: 1,583
    Hey John,
    Just so you know I am working on your project right now. For this create an integer attribute for each level. For level 1 create - LVL1Tanks starting at 3

    Then go into your car in lvl 1 an make it an instance. When it collides with a tank change game.LVL1TANKS to game.LVL1TANKS - 1

    RULE: When game.LVL1TANKS = 0, change scene to next scene :D

    Matt
Sign In or Register to comment.