i trying to make a grass title move accros the screen while in a loop or a for loop...here is what i have.
int main(int argc, char* argv[])
{
//Lets open the window and initialise opengl
InitGL(1024,768);
//Loads an Image, we store it in the integer grass
int grass = LoadTexture("./images/grass.png");
int sand = LoadTexture("./images/sand.png");
while //this is what i need to move?
{
//Used as a position for our tile of grass
float x = 100;
float y = 100;
float Rot = 0;
do
{
//Clear the screen, so previous frames don't build up
ClearScreen();
DrawLine(0,0,500,500);
DrawLine(100,0,500,500, SColour(0x00,0x00,0xFF,0xFF));
DrawLine(200,0,500,500, SColour(0x00,0xFF,0x00,0xFF), SColour(0xFF,0x00,0x00,0xFF));
//Left pressed move left
if (IsKeyDown(KEY_LEFT))
Rot -= 10.0f;
//Right pressed move right
if (IsKeyDown(KEY_RIGHT))
Rot += 10.0f;
x = (float)GetMouseX();
y = (float)GetMouseY();
DrawSpriteRotated(sand, x, y, 256, 256, Rot );
//Draw some grass
DrawSprite(grass, x, y, 128, 128);
//Example Text
DrawString("Some Text!!", x-80, y-100, 5.0f);
//Stop it from running too fast! Sleep ZZzzz
Sleep(5);
{
if(IsKeyDown(KEY_ESCAPE))
break;
}
} while (FrameworkUpdate()); //Do some secret stuff,
//Before you exit, clean up after yourself
FreeTexture(grass);
//Close down
CloseDown();
_CrtDumpMemoryLeaks();
//Quit!
return 0;
}