0 Favourites

[Solved] Rotate object around a point

  • Hi,

    I'm having trouble figuring out how to make this work in Construct3. Basically I want an object to rotate around a point using arrow keys (left to rotate clockwise and vice versa). Please refer to the image below.

    The green triangle moves along the blue ring with the red dot being the center point.

    I did come across some old construct2 samples but clueless as to how I should implement them in C3. (Center.X and Center.Y doesn't exist in C3 anymore?)

    Any help is very much appreciated. Thanks!

  • Construct 3

    Buy Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Buy Now Construct 3 users don't see these ads
  • Hi,

    I'm having trouble figuring out how to make this work in Construct3. Basically I want an object to rotate around a point using arrow keys (left to rotate clockwise and vice versa). Please refer to the image below.

    The green triangle moves along the blue ring with the red dot being the center point.

    I did come across some old construct2 samples but clueless as to how I should implement them in C3. (Center.X and Center.Y doesn't exist in C3 anymore?)

    Any help is very much appreciated. Thanks!

    You can make a clock look like this, let me give you an explanation on how to do this.

    First you make the orbiting sprite twice or trice as tall but put the image at the bottom, and set the origin to top.

    After that it should look a little like this.

    Then you can just rotate it like normal and it should orbit while pointing at the center. The end.

    And if you wanna make it to where you can switch it up with any sprite at any time, just erase the sprite's image and add an image point called Orbit or whatever, set it to bottom, then just constantly set a sprites position to the Sprite.ImagePointX("Orbit") Sprite.ImagePointY("Orbit"), and set its angle towards Sprite.ImagePointX("Origin"), Sprite.ImagePointY("Origin")

    None of this will work with physics, this would be near impossible and insanely complex to do with physics on the orbiting object unless it is set to immovable.

  • MorrisFeldman

    Your images are not showing but I think I get the gist of it. I seriously never thought of using the method that you mentioned. This will make implementing the other ideas I have in mind much easier.

    Thanks!

  • dropbox.com/s/bcdjvcyyj8m9mki/Sin%26Cos.c3p

    Thanks a lot! Exactly what I was looking for

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)