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
60
S
22
G
14
Posts: 1,479
Reputation: 16,346

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 Image
B
161
S
48
G
90
Posts: 7,356
Reputation: 66,767

Post » Mon Dec 02, 2013 12:03 pm

wow that was nice thanks
B
206
S
27
G
13
Posts: 1,845
Reputation: 35,820

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 ?
B
5
Posts: 22
Reputation: 269

Previous

Return to How do I....?

Who is online

Users browsing this forum: DiabloOvermind, spacedoubt and 3 guests