Randomly placing Actors
henriquesv
Member Posts: 18
Hello!
I have 4 groups of 4 different kinds of actors to place. Every group has to have 1 actor of each kind o actors. For example:
Group 1: Green, Red, Yellow and Blue.
Group 2: Red, Yello, Blue and Green.
... so on
I want to start a Scene placing these actors together in a random order.
Any ideas to do this?
I first thought about using a Table. But how to pick and place this actor?
Thank you!
Comments
The way you pick random selections without repeating is to place possible values in rows:
Green
Red
Yellow
Blue
And then choose a random row:
Change attribute self.row (integer) to random(1,tableRowCount(tableName))
Delete the table row at index self.row
Use self.row in a rule that spawns an actor depending on the value of that attribute.
New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User
Thanks!
I will try and let you know!
Working fine!