I’m making a game where the player throws a cube. I have 6 images that correspond to each cube, and I want to have shuffle effect like it’s randomly choosing between 1-6. How can this be done?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Take a look at this post: Is it possible to animate an UIImage?
All you need to do is stop the animation when you have selected the random image.
As @kernix said in the comment, to stop the animation after it has animated once, all you need to do is set the repeat count to 1.
In order to have a callback method called after the animation, please see the following post: Access Method After UIImageView Animation Finish