Random repeat (only repeat whats not on screen)

cnmeyer1980cnmeyer1980 Member, PRO Posts: 211
Hi everyone,

Just wondering if anyone can help me out with the below, I will try my best to explain what I'm trying to do.

Basically, an actor is spawned onto the screen, there are 24 actors, and the number is randomed between 1 and 24, so basically every 1 second a randomed actor will appear. If you click on them, they vanish.

Ok, this works great, no problems, however, the 1 thing I'm trying to work out is.... If for example actor 15 is on the screen, how it currently works 15 could be spawned again if its randomly chosen, what I'm trying to do is make it so an actor who's currently on screen won't get spawned again until its been removed (so you basically won't have 2 of the same actor on screen at any one time).

I'm not sure if I've really explained myself that well, however hopefully it may make sense?

If anyone has any tips that would be great, in the meantime I will carry on trying to figure it out.

Cheers as always
Chris

Comments

  • RThurmanRThurman Member, Sous Chef, PRO Posts: 2,881
    Think about it like a deck of 24 cards. First you shuffle them, and then your deal them off of the top.

    And when you remove the actor from the scene, you insert it back into the deck (either on the bottom, or randomly withing the deck).

    That's the general idea. Now think of a one column table like it was a deck of cards!
  • SocksSocks London, UK.Member Posts: 12,822
    @RThurman

    Seven of Heats ? Did I get it right ?

    : P

    Another way would be to simply have your 24 numbers 'cycling' (%24) and add [random 1, 23] on to the previous number.
  • RThurmanRThurman Member, Sous Chef, PRO Posts: 2,881
    @socks -- Yes!!!! Seven of Heats!
  • cnmeyer1980cnmeyer1980 Member, PRO Posts: 211
    Ha ha brilliant, love the video :) also, thanks for the advise guys, I will try it out now
  • SocksSocks London, UK.Member Posts: 12,822
    @RThurman

    Lol.
  • cnmeyer1980cnmeyer1980 Member, PRO Posts: 211
    Hi guys, I hope you're all well and had a great Christmas/NY.

    Ok, I've only just had chance to jump back into Gamesalad after the Holidays, and I'm still trying to work out how to do this - grrrr.

    Please see below a link to the file. If anyone has the time, and may know what to do, please feel free to download the file :)

    http://www.mediafire.com/?83l1qkhh99nly6d

    Cheers all.
    Chris
Sign In or Register to comment.