How to control the amount of times an actor spawns?
http_gamesalad
Member Posts: 1,340
I want to know if it's possible to control the amount of times an actor spawns in a given time period. For example let's say I want an actor to spawn once every 5 seconds and as the game goes on it'll spawn twice every 5 seconds and after 3, 4, 5, 6, until it spawns an actor once every
Comments
as the game get's harder I want it spawn more
Create a game attribute, call it spawncount.
Every time you spawn, increase game.spawncount by 1.
Now, put the spawner in a rule that says:
-When game.spawncount < 10
-spawn every 5 seconds
Otherwise
-if game.spawncount < 20
-spawn every 4 seconds
Otherwise
-if game.spawncount < 30
-spawn every 3 seconds.
Etc...
Hope this helped.
Mental Donkey Games
Website - Facebook - Twitter
While you can do it with rules, there are better and easier ways to do it. Check out this thread from last year that asked the same question.
http://forums.gamesalad.com/discussion/82113/need-help-with-increase-spawn-time-of-an-actor
My GameSalad Academy Courses! ◦ Check out my quality templates! ◦ Add me on Skype: braydon_sfx
@MentalDonkeyGames @Braydon_SFX
How this is set up now is that everytime a floor spawns the object spawns also. I can't figure out to make it spawn less & start spawing more rapidly
Bump?
Sorry to bumb more than once .. but I can't solve this
@http_gamesalad If you didn't understand @MentalDonkeyGames method, you can try this. I believe you can't change the timer during gameplay. So make a few rules, and say:
Rule: when score =>0 and score <5
timer: every 2.5 seconds spawn coin
Rule: when score =>5 and score <10
timer: every 2 seconds spawn coin
Rule: when score =>10 and score <15
timer: every 1.5 seconds spawn coin
etc etc....
It's really primitive but it should work:)
@approw instead of all those rules I tried to set the spawning on a timer. I noticed it doesn't work if I put the time to random timer. It does work if I put something like every one second. I checked the run to completion box also .. it doesn't work that great with it checked also.
Two people have given you suggestions for ways to set up custom timers but it sounds like you haven't tried either of them. The Timer behavior calculates the value in the expression (e.g. random(1,3)) and then uses that value for the timer. For more info and a workaround see http://forums.gamesalad.com/discussion/comment/464547/#Comment_464547.
New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User
Hey!!! I like the new display picture!!!! The old one boring. Use this only