I use an angle to set the velocity (or direction if you prefer) of my sprite, however, I want the sprite to be heading in the same angle as I'm moving, rotating according to that angle.
How I set angle and velocity:
angle = (float)Math.atan2(0 - pos.y, 220 - pos.x); //using bottom mid of screen as destination for testing //in update pos.x += 200 * Math.cos(angle) * delta; pos.y += 200 * Math.sin(angle) * delta; sprite.setPosition(pos.x, pos.y); //in render sprite.draw(batch);
is there any way to use this value in LibGdx's "sprite.rotate()" function? I can't do "sprite.rotate(angle)". Can I do this some other way? Can I convert my angle-value somehow to degrees? I'm stuck.
but that gave rly weird results, the following image is moving down and to the right