Random Generator
Elgondir
Member Posts: 4
So imagine that i have 6 random spawners on top of my screen, and i manage to make them randomly spawn, but i want one of the spawners and only one to spawn nothing randomly, how can i do this?
Basically i want 5 of the 6 spawners to spawn something every second , and 1 of them to spawn nothing every time the others spawn something, this one is chosen randomly each 1 second also.
Sorry if I was too confuse, tyvm in advance
Comments
@Elgondir, rather control all the spawning from one actor.
In this actor you can then spawn the 5 actors at once, deciding which lane not to use.
e.g.
self.EmptyLane = random(1,6)
rule if self.EmptyLane is not 1 then spawn in lane 1
rule if self.EmptyLane is not 2 then spawn in lane 2
ect.
MESSAGING, X-PLATFORM LEADERBOARDS, OFFLINE-TIMER, ANALYTICS and BACK-END CONTROL for your GameSalad projects
www.APPFORMATIVE.com
6 actors - and 1 controller actor.
. . . . .
The controller changes a game attribute (let's call it X) to a random number between 1 and 6.
. . . . .
In the 6 spawners (named 1,2,3,4,5 and 6)
Rule - if X = name then . . . (left blank - i.e. do nothing)
Otherwise spawn whatever it is you want them to spawn.
Try my demo that spawns 3 of 4 possible locations.
New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User
wow that is perfect, but 2 other questions if you don't mind.
1- that demo is great still it starts spawning a little bellow the top of the screen, how can i make it spawn from the top.
2- u only used 1 obstacle for the 4 spawners, how do i use diferent obstacles for the spawners but getting the same results?
The spawn actor behaviors use table cell values to determine the position of the actors. If you look at the positions table, you'll see that the Y value is the 2nd column. Just change the values in that column.
Try changing the actor name in the spawn actor behavior to make it spawn different actors.
New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User