I’m creating a fruit machine in Android.
The wheels on the fruit machine need to spin, using sprites at random.
There will be three wheels, each with three icons. I need to be able to make these icons random, and have them appear to be moving downwards. I have thought of a way to do it but don’t think it’s efficient, there must be a better way?
My idea is to have an array of 4 icons for each reel. hidden, top, middle and bottom.
I would use a transition to move the bottom one off and destroy, move the middle to the bottom, the top to the middle and the top hidden to the top. After the transition, I would then change the array to show the change, and introduce a new random sprite at the top.
Does this sound like the best way… or is there another?
Thanks,
Store the sprites in an array, then choose an item at random by
for an array of size 4.