Ferris wheel
Grolarbear
Member Posts: 50
I am trying to add in a ferris wheel to my game that cannot be done with an animation. Essentially it should be 4+blocks moving around a circle. These blocks should rotate around the circle but not themselves. I saw on the forums some ways to get it done( one by @BarkBarkCo). I did not fully understand how to get it done and his tutorial wasn't loading on my computer. I was wondering if anyone knew how to get this done?
Comments
I think the demo is still around here somewhere. It's on my hard drive somewhere, too. I'm sure you'd have a better chance of finding it on the forums.
My GameSalad Academy Courses! ◦ Check out my quality templates! ◦ Add me on Skype: braydon_sfx
Try this demo by @RThurman: http://forums.gamesalad.com/discussion/comment/413450/#Comment_413450
New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User
@Socks will be able to help you on this.
In each satellite block:
Constrain self.position.x to
Center.x + (radius * sin (angle) )
Constrain self.position.y to
Center.y + (radius * cos (angle) )
In block 1 the angle should be something + 0
In block 2 the angle should be something + 90
In block 3 the angle should be something + 180
In block 4 the angle should be something + 270
"Something" can be self.time and for faster rotations self.time*100 for example.
I could have the cos and sin the wrong way around but I am doing this from my phone so no way to test.
Cheers,
Ludwig
Lump Apps and My Assets
Thank you too all who posted on this and special thanks to @tatiang for getting me the demo I just edited a few things and I was all set to go
Yep, you have sin and cos in the 'wrong' places, but it just means the wheel will rotate clockwise as the angle increases, rather than the mathematical convention of angle increasing as you go counterclockwise.
Yep, they are the wrong way around like you say, but it doesn't really matter as all it will do is make the orbiting objects rotate clockwise rather than the mathematical convention of counterclockwise (as the angle increases).
Yep, you have sin and cos in the 'wrong' places, but it just means the wheel will rotate clockwise as the angle increases, rather than the mathematical convention of angle increasing as you go counterclockwise.
Yep, they are the wrong way around like you say, but it doesn't really matter as all it will do is make the orbiting objects rotate clockwise rather than the mathematical convention of counterclockwise (as the angle increases).