How do I do Circle

0 favourites
  • 4 posts
From the Asset Store
Dodge the spikes and collect the gems as you orbit the circle.
  • Ok I have been trying to figure this out myself but been stumbling over it too long and wanted some real math people to help me here.

    I have the X,Y of my initial Touch, with my touch I pull back in any direction (think like Angry birds) which I then have the angle of my initial touch and my current touching point.

    What I need is to be able to get the X,Y of a point the opposite angle I am pulling but only a certain amount of pixels. So essentially, where I am pulling back there should be a dot on the opposite side of the circle but only 30 px from the center point (not the distance of my current touch to the center, just a set amount). So I can just drag around and there should be a dot making a perfect circle at the same distance away from the center point.

    Does that make sense?

    I had been trying to set the dot using a formula I saw on here but it's not working on most angles.

    X = X + 30 * cos(angle)

    Y= Y + 30 * cos(angle)

    Any help would be fantastic!

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Use sin() to get the Y component.

  • Ha! That's amazing, I will try that! I fell asleep a lot in my Trigonometry class...

  • lel, when you said "circle math" I thought about eating some pi. A nice apple pi would be so rad.

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