Spawn Limiter
FatalCrest
Member Posts: 113
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!
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
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
Dr. Sam Beckett never returned home...
Twitter: https://twitter.com/Quantum_Sheep
Web: https://quantumsheep.itch.io
(Sorry about how I type out what I say I kinda rush when I type, so it makes it confusing)
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))
yeah...
Good Luck!
Dr. Sam Beckett never returned home...
Twitter: https://twitter.com/Quantum_Sheep
Web: https://quantumsheep.itch.io
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