Welcome, Guest. Please login or register. Did you miss your activation email?

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Topics - SamuelGHOST

Pages: [1]
1
General / Smooth rotation of a sprite
« on: November 30, 2018, 11:51:06 am »
Let's say that I have a sprite and with code shown below I obtained a rotation angle:

rotation = (atan2f(dy, dx)) * 180 / 3.14159265;

How do I rotate a sprite smoothly with angle I have in "rotation"? I tried something like this but it didn't work:

for (int i = 0; i < rotation + 180; i++)
   sprite.setRotation(i);

2
Graphics / Rotation of a sprite
« on: November 24, 2018, 06:56:59 pm »
Let's say that I have current and next coordinations of a sprite. How do I rotate sprite towards the position of the next coordinations?

3
Graphics / Moving sprite using certain path
« on: November 24, 2018, 05:26:40 pm »
I have a vector that contains points. I already can move sprite from point A to point B, but I don't know how to move sprite from point A to point B, then to point C and so on. How to move sprite by multiple points that my vector have?

Pages: [1]