0
\$\begingroup\$

My maths isn't as good as it should be, I need to pick up some reference books on Trig.

Could someone give me an idea of the maths if I wanted to revolve many sprites around a central point?

It's a 2D system in MonoGame.

I'm going to try to describe the scenario, I can't think of anything quite like it to reference.

Imagine a game screen, you are looking down on the world, with my character in the middle, my character sprite will never change, but if I turn left or right I want everything else to rotate around the central point. Of course every sprite will have to be moved, and also rotate to account for the spin.

Can someone point me in the right direction? Thanks.

\$\endgroup\$
1
  • \$\begingroup\$ Well, I couldn't find them. \$\endgroup\$ Nov 25, 2016 at 4:36

1 Answer 1

0
\$\begingroup\$

I recall an Amiga game Rotox based on that principle.

To rotate easily look into Vector2.Transform(). You can feed it a matrix such as Rotation and translation matrices.

point = Vector2.Transform(point, Matrix.CreateRotationZ(AngleToRotate);
point += originPoint;
\$\endgroup\$

Not the answer you're looking for? Browse other questions tagged .