Wheel of fortune:)

Get help using Construct 2

Post » Tue Feb 21, 2012 11:08 am

I mean wheel rotate and when stops on one of 8 fields > do something
How do i that thing?
B
93
S
19
G
34
Posts: 1,840
Reputation: 27,963

Post » Tue Feb 21, 2012 12:03 pm

360/8=45 so pick a random number 1-8 multiply it by 45.
If we get anglelerp you could just do:
sprite set angle to anglelerp(self.angle,random*45,something*dt)
Image Image
B
161
S
48
G
90
Posts: 7,356
Reputation: 66,767

Post » Tue Feb 21, 2012 4:17 pm

i try figure it out
B
93
S
19
G
34
Posts: 1,840
Reputation: 27,963

Post » Tue Feb 21, 2012 9:14 pm

Randomly generating an angle is okay if all you want is the answer, but if you want to show the wheel rotating, you could take an approach like this one. I randomly generate an angle (number of degrees, then rotate the wheel that number of degrees and check to see what wedge on the wheel the needle overlaps.

I'm sure it could be made much better with lerps and things. It isn't 100% accurate, but it may help you.

WheelOfMisfortune.capx

B
29
S
11
G
12
Posts: 281
Reputation: 11,878

Post » Tue Feb 21, 2012 9:56 pm

wow you helped me a lot Thanks! :)
B
93
S
19
G
34
Posts: 1,840
Reputation: 27,963

Post » Wed Feb 22, 2012 5:08 pm

I used Kittiewan's graphics and build a version that uses physics to add realism...

CAPXWeishaupt2012-02-22 17:10:03
B
42
S
19
G
12
Posts: 723
Reputation: 13,911

Post » Wed Feb 22, 2012 5:30 pm

its cool too :)
B
93
S
19
G
34
Posts: 1,840
Reputation: 27,963


Return to How do I....?

Who is online

Users browsing this forum: BipolarMike, totoe and 15 guests