Quantcast
Channel: GameDev.net
Viewing all articles
Browse latest Browse all 16874

rotate a sprite

$
0
0

I am still working on a slot car simulation game. I have got the car to move  up the track to the bend in the track. My question is how do I get the car sprite to move around the bend in the track while the sprite rotates from going up to going to the left. my code moves the center of the sprite in a curve like fashion but it does not rotate the sprite. I am  using the sin and cos functions. here is the code I am working with.

void rotateSprite()
{
	x = cos(i);
	y = sin(i …

Viewing all articles
Browse latest Browse all 16874

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>