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.


Messages - SamuelGHOST

Pages: [1]
1
General / Re: Smooth rotation of a sprite
« on: November 30, 2018, 04:21:34 pm »
Could you give me an example please?

2
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);

3
Graphics / Re: Moving sprite using certain path
« on: November 25, 2018, 01:28:08 pm »
Move your sprite from A to B, and then from B to C.

I'd do it by adding a variable "last point reached", with the index in the vector of the point you started at (e.g. you start at A (0), go to B(1), then C(2)...)

The problem is that in "while loop" sprite instantly moves from one point to another. I want it to move smoothly to the next point.

4
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?

5
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]
anything