Spinning Wheel with Random Result
MightyBoosh
Member Posts: 83
Ahoy Ahoy
I want to make a wheel of fortune / road trip (arcade game) type spinning wheel that spins with ether the users touch or by shaking the iphone (whatevers easier really)
It needs to go hard at the start then slow down as it loses momentum, eventually stopping and giving a result
I have zero idea how to do this can someone point me in the right direction?
Cheers
I want to make a wheel of fortune / road trip (arcade game) type spinning wheel that spins with ether the users touch or by shaking the iphone (whatevers easier really)
It needs to go hard at the start then slow down as it loses momentum, eventually stopping and giving a result
I have zero idea how to do this can someone point me in the right direction?
Cheers
Comments
You need 2 attributes:
self.startUpTime (real)
self.slowDownTime (real)
self.startUpTime=(random(100,400))*.01 (this will give you a number from 1 to 4 with 2 decimal places for more random results in your length of time to spin.
self.slowDownTime=2*self.startUpTime
Then use the first value to start the spin. After the startUpTime...switch to slow down.
Allow the actor to slow rotation for the second length of time....probably interpolate will work best. Adjust the values as needed for smooth results. May require some tweaking/trial and error.
Then have whatever ending actor rotation value results equate to a value on the wheel.
Its a logic structure solution I have here...you all will have to work out the details as I don't really want to spend 2 or 3 hours to do so.
Good Luck!
place an interpolation behavior for:
self.rotation to self.rotation*.05
duration=self.startUpTime (ease in)
(then inside a delay timer)
try an angular drag ramp up interpolation (ease out) to slow the wheel rotation down to 0.
Not sure about this idea without testing directly...but it might work.