Random Spawning but with a count?
http_gamesalad
Member Posts: 1,340
Hello, I would like to know how to achieve a random spawn but with a count every time.
I want to spawn an object all over the screen multiple times it doesn't matter where it spawns but I want there to be a count.. so lets say its first spawn happens but only 30 objects spawn, the second time it spawns I would like it to spawn 17, third time it spawns I want it to spawn 67 & ect.. completely random
Comments
In the actor you are spawning have it update a game level attribute when it is spawned, like:
Make an Integer Game Attribute named: actorCount
In the actor you are spawning put a Change Attribute Behavior:
Change Attribute actorCount to actorCount + 1
That way when one is spawned on screen it will keep a count and you can use it as you see fit.
http://jamie-cross.net/posts/ ✮ Udemy: Introduction to Mobile Games Development ✮ Learn Mobile Game Development in One Day Using Gamesalad ✮ My Patreon Page
@jamie_c thanks you now how can I set a limit to the amount of spawns?
I made a second actor & put the display text in it so I can see how many it spawns
Set up a rule that says something like:
This would limit the number of actors spawned to 30.
http://jamie-cross.net/posts/ ✮ Udemy: Introduction to Mobile Games Development ✮ Learn Mobile Game Development in One Day Using Gamesalad ✮ My Patreon Page
@jamie_c woked perfect
worked *
@jamie_c hey sorry to bother you again but lets say I wanted to spawn a bunch of random actors at the same time example 10 at one time in a straight line how can I do this?
In the spawn behavior there is the spawn offset for X and Y location. You can use an Attribute there and increment it to spawn in a line.
Do these actors that are spawned need to interact with other actors or are they something interface related, like 10 hearts in a row to display player health? If that is the case you could just use a Replicate Behavior.
http://jamie-cross.net/posts/ ✮ Udemy: Introduction to Mobile Games Development ✮ Learn Mobile Game Development in One Day Using Gamesalad ✮ My Patreon Page