How do I make earth rotate around the sun?

Get help using Construct 2

Post » Wed Jan 11, 2012 6:17 pm

This is something I'd been trying to get to work, so this is very helpful. What would you need to do to let the player control rotation? I'm thinking of using this method for a targeting cursor that rotates around the main character when the player aims.
B
4
G
2
Posts: 11
Reputation: 774

Post » Wed Jan 11, 2012 6:38 pm

just the angle between the mouse and the character

angle(character.X,character.Y,mouse.x,mouse.y)

you plug that in the formula above and that should do the trick
B
66
S
22
G
14
Posts: 1,484
Reputation: 16,511

Post » Wed Jan 11, 2012 6:39 pm

[QUOTE=deathofthedead] This is something I'd been trying to get to work, so this is very helpful. What would you need to do to let the player control rotation? I'm thinking of using this method for a targeting cursor that rotates around the main character when the player aims.[/QUOTE]

Something like:
sprite set position to player.x +cos(angle(player.x,player.y,mouse.x,mouse.y))*dist
player.y +sin(angle(player.x,playr.y,mouse.x,mouse.y))*dist
Image ImageImage
B
169
S
50
G
174
Posts: 8,330
Reputation: 110,804

Post » Mon Dec 02, 2013 12:03 pm

wow that was nice thanks
B
252
S
39
G
15
Posts: 1,964
Reputation: 40,763

Post » Tue Nov 25, 2014 2:28 pm

It's working, I tried to make another object rotate around the previous one and it worked :D
B
5
Posts: 46
Reputation: 334

Post » Sun Oct 09, 2016 11:16 am

But how I can change the center point in realtime without the object be wrapped at the top of second center point ?
Image
B
6
S
2
Posts: 42
Reputation: 538

Previous

Return to How do I....?

Who is online

Users browsing this forum: Blendi1223, jatin1726, kiki4construct, Kyatric and 26 guests