Help with angle calculation!
Hello!
So, I looked some smooth rotating examples and found those amazing!
However, my game is side-scrolling and I was hoping to create a flashlight you can control with your mouse.
And to make it work for my game I need to limit the angle. Player can only rotate it around 90 degrees. So the angle is limited, you can't look too high up or right at the floor, but around 90 degrees front of you.
If players looks right, the light shines right and can be moved around 90 degrees.
If player looks left, the light shines left.
Been playing around with numbers and angles. But I can't get this to work.
One great example suggested: (end-start+540)mod360-180
I think that by tweaking that formula I could make it work. Any help here would be appreciated!
Big thanks, again! :)
- Jesse