if (keys[’ '] && !sp)
{
sp=TRUE;
object++;
if(object>5)
object=0;
}
if (!keys[' '])
{
sp=FALSE;
}
if (keys[VK_PRIOR])
{
z-=0.02f;
}
if (keys[VK_NEXT])
{
z+=0.02f;
}
if (keys[VK_UP])
{
xspeed-=0.01f;
}
if (keys[VK_DOWN])
{
xspeed+=0.01f;
}
if (keys[VK_RIGHT])
{
yspeed+=0.01f;
}
if (keys[VK_LEFT])
{
yspeed-=0.01f;
}
if (keys['t'] && !tp)
{
tp=TRUE;
while(xspeed!=0.00f)
{
xspeed=0.00f;
}
while(yspeed!=0.0f)
{
yspeed=0.00f;
}
}
if (!keys['t'])
{
tp=FALSE;
}
When i pressed the spacebar the image will loop to display a series of images. The VK_UP, DOWN, LEFT ,RIGHT are to rotate the image. VK_NEXT, PRIOR are to increase and decrease the image depth.
Ok. My problem is that when the image is rotating after the arrow keys are pressed, i want to stop the rotation by pressing the ‘t’ key. But i cant seem to get it…
What’s wrong with my coding??
Can anyone help??? Thanks in advance…