How to stop actors from spawning

ckurt25ckurt25 Member Posts: 122
edited November -1 in Working with GS (Mac)
So part of my game is similar to Falling Balls. You have an actor spawn and bounce / fall or whatever and leave the screen. From what I can tell in Falling Balls, score is kept once one of the balls leaves the screen, to the right. Once you are killed no more balls spawn and the ones currently on the screen do not add to the score once they leave the screen.

I've built my game to score a point once the falling actor touches an invisible actor at the bottom of the screen. In my game you have health and once that hits 0 the game is over. Currently I have "game over" come on that screen for a few seconds before you are taken to the new screen that displays your score, the high score and an option to play again. Because there are a few seconds that elapse between health reaching 0 and you jumping to the next scene, the falling actors continue to touch the invisible actor and add to the score. Ideally I'd like the actors to either stop falling or stop scoring once health hits 0. I know I could just immediately jump to the next scene but if I can come up to do it like Falling Balls, I'd rather do it that way. Any ideas?

Thanks in advance for all your help.

PS - I've only been doing this for 2 days so go easy on me ;)

Chris

Comments

  • ktfrightktfright Member Posts: 964
    one thing you can do is make a global boolean (true/false) attribute that checks if the falling actors can spawn. if your character dies, change the attribute so that it becomes false.

    make it like:

    if attribute: can spawn = true, then let the falling actors spawn

    if character actor is destroyed, change attribute can spawn = false.

    hoped that helped a bit.
  • ckurt25ckurt25 Member Posts: 122
    Thanks for the quick reply, ktfright. I guess that would help keep them from spawning but I could have up to 3 or 4 actors on the screen when I "die" and those few would artificially add to the score. Could I do the same thing except make it score in stead of spawning?
  • JamesZeppelinJamesZeppelin Member Posts: 1,927
    Have the game over message also spawn an invisable Full screen actor called something like destroyer. Your balls can just have a destro actor when the collide with destroyer rule. The full screen actor shouldn't eat up memery if here is no hug graphc attached to it
  • ckurt25ckurt25 Member Posts: 122
    Thanks TinyMonster! That got me on the right track. What I ended up doing was creating a rule for my actors (not actually balls) that basically says when game life =0 destroy the actor. Just needed to be pointed in the right direction. Thanks again.
Sign In or Register to comment.