Ferris Wheel
dknell
Member Posts: 48
Hi everyone,
I have been trying to figure out how this would work and I'm not getting very far. I want to put a moving ferris wheel in a game. The main wheel would rotate at a constant rate while about 10 boxes around the wheel would MOVE (not rotate) at the same rate the wheel is moving. I don't know why I'm explaining how a ferris wheel works - you've seen it before.
Anyone have any tips on how to make the boxes move around at the same rate the wheel is rotating?
If any of you GameSalad gurus want to show off your skills, the stage is yours!
Thanks!
Dave
I have been trying to figure out how this would work and I'm not getting very far. I want to put a moving ferris wheel in a game. The main wheel would rotate at a constant rate while about 10 boxes around the wheel would MOVE (not rotate) at the same rate the wheel is moving. I don't know why I'm explaining how a ferris wheel works - you've seen it before.
Anyone have any tips on how to make the boxes move around at the same rate the wheel is rotating?
If any of you GameSalad gurus want to show off your skills, the stage is yours!
Thanks!
Dave
Comments
_________________________________
HOLY NOSE JOB!: Nesen Probe: Is this the single most unappealing game in the history of GameSalad? I can't seem to give it away! Anywhere. But if anyone want's to try it out, codes are still available! http://gamesalad.com/forums/topic.php?id=8097
I'll edit with more detail shortly..
Enjoy!
Edit: Sorry for the brevity...I can't get my MacBook online while at work, so I had to run out to "Lunch" and find a hotspot...
Anyway, I took this: http://gamesalad.com/wiki/how_tos:gsc_circular_movement
...and added support for a moving base object and a bucket position offset.
Post here or email me if you have any questions, GSusername@gmail.com
Constrain self.position.x to:
`45*cos((self.time*game.RotateSpeed)-(self.BucketID*36))%360)+game.WheelX`
Constrain self.position.y to:
`45*sin((self.time*game.RotateSpeed)-(self.BucketID*36))%360)+game.WheelY`
45 = Radius
game.RotateSpeed = Global value also used in the wheel actor to control speed of rotation
self.BucketID = Unique integer added to each bucket (0-9), multiplied by 36 (360/bucket count) to control angle offset.
Thanks for the example!
I'll add some graphics and hopefully will have a demo uploaded in the next week or so.
Dave
BTW, If the wheel's center is fixed in the scene, you can replace the references to the wheel's X and Y with static values for the center point.