Highlighted

## Creating a "Wheel of Fortune" wheel with moving arrow

New Here ,
Apr 03, 2019

Copy link to clipboard

Copied

I'm creating a wheel with pegs that will spin and as they make contact with the pointer, it will be pushed by the pegs and snap back into position. I'm having problems coming up with a solid solution on how to best achieve this effect. My current solution is to run a for loop to test a collision of each peg, then tell the pointer to look at the peg till the collision is false. On that note it will fall back into place. The 2 main issues are:

• If the wheel spins too fast, the pegs can likely skip over the arrow. My idea currently is to detect motion of the wheel spin and if over an amount, tell the arrow to angle as though it had been hit.

• When the arrow makes contact it will do a small snap, as the body of the arrow is wider in certain areas and the peg needs to be pushing it based on where it's sliding against the arrow. It's not too drastic as it's near the tip, but I want a more realistic look here.

Are there any tutorials or tools that can achieve this? I haven't found any examples to pull from on achieving this simple effect.

TOPICS
ActionScript

Views

601

Likes

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more

## Creating a "Wheel of Fortune" wheel with moving arrow

New Here ,
Apr 03, 2019

Copy link to clipboard

Copied

I'm creating a wheel with pegs that will spin and as they make contact with the pointer, it will be pushed by the pegs and snap back into position. I'm having problems coming up with a solid solution on how to best achieve this effect. My current solution is to run a for loop to test a collision of each peg, then tell the pointer to look at the peg till the collision is false. On that note it will fall back into place. The 2 main issues are:

• If the wheel spins too fast, the pegs can likely skip over the arrow. My idea currently is to detect motion of the wheel spin and if over an amount, tell the arrow to angle as though it had been hit.

• When the arrow makes contact it will do a small snap, as the body of the arrow is wider in certain areas and the peg needs to be pushing it based on where it's sliding against the arrow. It's not too drastic as it's near the tip, but I want a more realistic look here.

Are there any tutorials or tools that can achieve this? I haven't found any examples to pull from on achieving this simple effect.

TOPICS
ActionScript

Views

602

Likes

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Apr 03, 2019 0
1 Reply 1
LATEST
Enthusiast ,
Apr 04, 2019

Copy link to clipboard

Copied

If you aren't already, I would recommend using Greensock's ThrowProps plugin for achieving this.

As the wheel spin around you could check the pointer's coordinates and current speed with help from the tween's onUpdate function.

Likes

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Apr 04, 2019 0