How easy (or hard) is a random position with a rule?

SaveDaveSaveDave Member Posts: 140
edited November -1 in Working with GS (Mac)
the idea is as follows....

I have three actors.. (top middle and bottom)

i want there position to change with one another randomly every 5'seconds or so.

however i do not want a situation where there are two or three of the actor in the same position.

It has to be random and it always has to have each of the three positions filled with one of the three actors.

any help would be fantastic.

Comments

  • firemaplegamesfiremaplegames Member Posts: 3,211
    Since you only have 3 items, there are only 6 possible combinations:

    123
    132
    213
    231
    312
    321

    You could just use a random number between 1 and 6. Whatever the random number is, force the actors into those positions.

    That's a quick and dirty solution since you only have three actors.
  • SaveDaveSaveDave Member Posts: 140
    Ace!

    Nice one FMG!!
Sign In or Register to comment.