i'm currently messing around with some game code, in an effort to personalize it. its a basic car-around-the-track type set up for now.
the code they have is:
so, turning left is done by "car._rotation = 180;"Code:function setCarMove(d) { if (d == 0) { nextX = pacX; nextY = pacY - 1; car._rotation = 90; } else if (d == 1) { nextX = pacX + 1; nextY = pacY; car._rotation = 180; } else if (d == 2) { nextX = pacX; nextY = pacY + 1; car._rotation = -90; } else if (d == 3) { nextX = pacX - 1; nextY = pacY; car._rotation = 0; }
...however... because of the graphics i've used, my car can't be roatated, or else it looks upside-down. is there a way to set this one variable to flip the image horizontally, instead?




Reply With Quote