Spawn Limiter

FatalCrestFatalCrest Member Posts: 113
edited November -1 in Working with GS (Mac)
How can I create a spawn limit and stopping the spawn function?

So far i created a Boolean called spawnLimitMax then set it to false.
Then I created an interger called spawnAmount and gave it the amount 0.

Note: I just want to keep the spawnAmount to go to 1 for now.

This is how I want it to work though, when I touch my actor it spawns another actor(the enemy),
then i want it so that after it spawns i can't respawn anymore of the enemies.

When you tap the actor it'll add one to spawnAmount, then when spawnAmount = 1,
spawnLimitMax = true. So when spawnLimitMax = true it will disable the spawn from any tap on
my actor.

I need a little help here because I can't find a way to disable the spawning!

Comments

  • quantumsheepquantumsheep Member Posts: 8,188
    You're certainly on the right track!

    I started to write it all out, but it was easier to actually make it!

    You can find the example here:

    http://gamesalad.com/game/play/61275

    Hope that helps!

    QS :D

    Dr. Sam Beckett never returned home...
    Twitter: https://twitter.com/Quantum_Sheep
    Web: https://quantumsheep.itch.io

  • FatalCrestFatalCrest Member Posts: 113
    I'm gonna see what I can do know! Thankies! :3
    (Sorry about how I type out what I say I kinda rush when I type, so it makes it confusing)
  • chosenonestudioschosenonestudios Member Posts: 1,714
    alrighty then... It seems like you have the spawning down.... but....

    instead of spawning you might want to just change the alpha of your actor (so you don't have to spawn (spawning hurts the processor pretty bad))
  • FatalCrestFatalCrest Member Posts: 113
    Hmm... not a bad idea! But I think this is the only thing I'll probably spawn out of this project so...
    yeah...
  • chosenonestudioschosenonestudios Member Posts: 1,714
    FatalCrest said:
    Hmm... not a bad idea! But I think this is the only thing I'll probably spawn out of this project so...
    yeah...

    aight... was just a heads up...

    Good Luck! :D
  • quantumsheepquantumsheep Member Posts: 8,188
    Glad to help :D

    Dr. Sam Beckett never returned home...
    Twitter: https://twitter.com/Quantum_Sheep
    Web: https://quantumsheep.itch.io

  • scitunesscitunes Member, Sous Chef Posts: 4,047
    I don't see the need for the boolean and the integer. Just have the integer.

    In the spawner have a rule that says

    when game.spawnamount < some number
    ---Rule: when touch is pressed
    --------- spawn actor

    Then in the enemy actor that gets spawned have a change attribute behavior

    change game.spawnamount to game.spawnammount+1
Sign In or Register to comment.