Ferris wheel

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

  • Braydon_SFXBraydon_SFX Member, Sous Chef, Bowlboy Sidekick Posts: 9,273

    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. ;)

  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949

    New to GameSalad? (FAQs)   |   Tutorials   |   Templates   |   Greenleaf Games   |   Educator & Certified GameSalad User

  • gamestudentgamestudent Member Posts: 504

    @Socks will be able to help you on this. ;)

  • LumpAppsLumpApps Member Posts: 2,881
    edited August 2014

    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

  • GrolarbearGrolarbear Member Posts: 50

    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

  • SocksSocks London, UK.Member Posts: 12,822

    @LumpApps said:
    I could have the cos and sin the wrong way around but I am doing this from my phone so no way to test.

    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.

  • SocksSocks London, UK.Member Posts: 12,822

    @LumpApps said:
    I could have the cos and sin the wrong way around but I am doing this from my phone so no way to test.

    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).

  • SocksSocks London, UK.Member Posts: 12,822

    @LumpApps said:
    I could have the cos and sin the wrong way around but I am doing this from my phone so no way to test.

    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.

  • SocksSocks London, UK.Member Posts: 12,822

    @LumpApps said:
    I could have the cos and sin the wrong way around but I am doing this from my phone so no way to test.

    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).

Sign In or Register to comment.