Random number with an excepetion

alexodalexod Member Posts: 10
edited November -1 in Working with GS (Mac)
Hello,

I want to randomly pick from 16 actors to go across the screen one after the other, but not to repeat the actor until it has gone off the other side of the screen.

I therefore, assume....

I want to pick a random number from 1-16.

This number will then change an attribute to true for a certain, differing amount of time.

During this time, I wish to pick another random number from 1-16, but not the number that has changed the attribute to true.

Am I making any sense?

Any help would be greatly appreciated.

Comments

  • old_kipperold_kipper Member Posts: 1,420
    Basically that is the long and short of it. There are different methods for selection and making the choices null, but there is no quick fix. I would use a master control actor to recycle/spawn the one of 16, with booleans for a fired actor which is checked to see if the actor can be spawn and if not then run random again. You can also do it by making a ladder of the available actors and do a drop to cover any gaps of chosen/unavailable and then run the random over the available, but this is somewhat complex to set up.
  • hman360hman360 Member Posts: 590
    I have an idea but it would be hard to explain. If you still need help, I may be able to do a video tutorial tonight if I'm not busy.
  • alexodalexod Member Posts: 10
    Thanks guys.

    Well I am happy to go with Old Kipper's method...unless hman360, your idea is that much better. A video tutorial would obviously be fantastic but please don't worry if you can't be bothered.

    The one other factor is as the game progresses I wish for these actors to go faster and faster across the screen and therefore time is of the essence.

    Thanks again - this is only the second time I have posted a question and am amazed by the speedy and helpful responses.
Sign In or Register to comment.