Hi everyone,
So the slot/lotto machine ended up going well at the End-of-Year Company party. Staff won prizes and merriment was enjoyed by all!
There was no other examples of what I wanted here yet (chrisbrobs thatnks for trying!) so, I'm posting the full capx for anyone to use at their own party if they want. ^.^ Have tried to comment the capx everywhere as much as possible.
docs.google.com/open
DISCLAIMER: This is SUPER hacky.. but it got the job done. With only a few hours on weeknights and weekends to do this, it didn't need to be pretty code-wise, just work. I've since removed all the photos of people/prizes and the propriety art, so the capx just has my orsum stick drawings in it now as replacements. It's enough for you to get the idea though. The random number generation uses kittiewan's "Generating Random Numbers Without Duplicates" tutorial (which is solid!).
Notes:
-The slot spinning effect is purely for show. Even if a person/prize has come up before, they will show up in the spinner as it is only animating the sprite for show. I wanted to find a way to remove staff/prizes as we went along eventually whittling the staff/prize lists down but, ran out of time. This got the job done.
-There are actually 2 random generators for the prizes. The first one occludes the last few frames of the prize sprite (which contained the Grand Prizes). After a certain number of spins, I stop using the 1st generator with the limit, and switch to the no-limits generator allowing for the possibility of a Grand Prize coming up. This way you guarantee a Grand Prize will come up somewhere towards the end and not on the 1st damn spin.
-To increase/decrease the number of staff/prizes just play with the Global Variables at the top. I didn't get time to cleanly rig everything up to be pointing at just 1 place though, so you'll need to hand adjust the "countdown" global here & there as well to match your number of prizes.
-Having the keyboard not accept inputs until spinning has ended was critical! After a few drinks, people will just hammer that Spacebar if they're gonna win stuff so, it needed to be robust. :D
If anyone has any questions (or suggestions on cleaner ways to achieve these results!) feel free to comment. ^^/