Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android - tips on creating slot machine animation

I want to create an animation like a slot machine, in Android, but I'm not sure how to do this.

I want the animation to look like this: http://www.youtube.com/watch?v=EX-uzP6BdjI (its pretty obvious I guess), but then with 8 bars, and instead of the fruits, I want letters.

Now, I've already got the image of the letters (seperate for each letter, and one for all letters). But because I want to display the letters in some sort of frame, I need to keep the letters within that frame (just like the example), which seems very hard to me, with one image.

What is the best way to make an animation like this?

The end position (the final letter) will be randomly chosen before the animation starts, and the animation needs to be able to change depending on that letter.

The animation doesn't have to be smooth (it can come to a sudden stop at the ending, instead of a smooth ending), but if it's easy to do, I'd prefer that.

like image 831
laarsk Avatar asked Nov 12 '22 21:11

laarsk


1 Answers

Try creating an animation video of each possible scroll, then randomly choose the outcome and play the corresponding videos. a simple if clause can call the correct video, although if you have many possibilities, you might prefer to use switch case. If you do so, then you can put together photographs of each predetermined outcome, and use them for your drag and drop imageview.

like image 102
maxMak Avatar answered Nov 15 '22 10:11

maxMak