Respawning actor after he's destroyed

butterbeanbutterbean Member Posts: 4,315
edited November -1 in Working with GS (Mac)
Total newbie here so I apologize in advance

I've followed the tutorial on GameSalad and have a TOTAL LIVES game attribute added with 3 lives available. I also created a rule that once the actor is destroyed, to minus 1 in the total lives attribute
How do I respawn the actor and make him invincible for 3 seconds once respawned?

Do I create a rule also once player lives reach 0 that the game is over?

If there is a link to some of this, I apologize in advance, Thank you :)

Comments

  • JGary321JGary321 Member Posts: 1,246
    For respawning you could probably have a game attribute called "player alive" & set it to 1 to start. When it's killed make it so it changes it to 0. Then Set a rule that would spawn actor when game attribute 'player alive' was changed to 0.

    The invincible part there is a tutorial on that. I don't know off hand (im at work)

    For game over if you want it to go to a new screen set a rule that when total lives = 0 change scene to game over scene. (or whatever u want to call scene)

    You could also set it so that just a text box pops up. Doing something similar. Hope this helps. Post if you need more help. Thats what we're here for.
  • butterbeanbutterbean Member Posts: 4,315
    Do I create the Rule under the destroy actor Rule? Or is this a separate Rule in a separate box?

    Also, is the player alive game attribute boolean or integer? I'm assuming integer

    If I want 3 lives to start, how would I create a rule so that it only spawns the actor if player lives is 1-3?
  • JGary321JGary321 Member Posts: 1,246
    It would be a seperate Rule that Spawn Actor would go in.

    Player alive would be Boolean, im sorry. in Boolean 0=off & 1=on. I should have said Boolean I'm sorry.

    If you make it so total lives = 0, change scene to game over, then you want have to worry about that.

    If your talking about when you reset the game, your lives would reset, you could make a "Done" button on game over scene that changes attribute games lives to 3 & also changes scene to game scene(or whatever you call it).

    You'll probably need to do a bit more for resetting the level, but this should help.
  • butterbeanbutterbean Member Posts: 4,315
    Thanks, I decided to make the player have 3 health bars instead, and figured it out with your help, thanks!
Sign In or Register to comment.