• Create Account

#ActualiQuality

Posted 18 August 2012 - 06:58 AM

Are you wanting to move one object, and then a few seconds later, the next object? Are you wanting a delay/pause in time before each object moves?

Yes, your understand me correctly. But the problem of delay - its stoppes all the "game loop", it will just pause for a while all loop, at as a result it would do nothing except of changing the speed of movement.
Ill explain it in code:

while( n <= objects)
{
array[n].x+=0.02;
SDL_Delay(2000) // the code stoppes for 2 seconds, so the iterations stops too. As a result the 'n = 0' object moves fo "0.02" pixels,
//then stoppes for 2 seconds, and after it another 'n = 1'object moves for "0.02" pixels and stoppes.
n++;
}

that will move in column one after another

I think this part needs to be explained in a little more detail.

If you want to "see" anything move, you'll have to render your scene after every single displacement. Also, it might help to position your objects in different locations; Right now, they're all initialized to the exact same values, so x and y are set to 0 and 200, respectively.

Yes, with rendering scenes all correct, the problem is with movement objects, like Goran Milovanovic says, I need a delay after all of my objects.
In another word, im making like simple "tower defence game", and i need to generate my enemies, that will move in column, without collision.

#3iQuality

Posted 18 August 2012 - 06:58 AM

Are you wanting to move one object, and then a few seconds later, the next object? Are you wanting a delay/pause in time before each object moves?

Yes, your understand me correctly. But the problem of delay - its stoppes all the "game loop", it will just pause for a while all loop, at as a result it would do nothing except of changing the speed of movement.
Ill explain it in code:

while( n <= objects)
{
array[n].x+=0.02;
SDL_Delay(2000) // the code stoppes for 2 seconds, so the iterations stops too. As a result the 'n = 0' object moves fo "0.02" pixels, then stoppes foe 2 seconds,
//and after it another 'n = 1'object moves for "0.02" pixels and stoppes.
n++;
}

that will move in column one after another

I think this part needs to be explained in a little more detail.

If you want to "see" anything move, you'll have to render your scene after every single displacement. Also, it might help to position your objects in different locations; Right now, they're all initialized to the exact same values, so x and y are set to 0 and 200, respectively.

Yes, with rendering scenes all correct, the problem is with movement objects, like Goran Milovanovic says, I need a delay after all of my objects.
In another word, im making like simple "tower defence game", and i need to generate my enemies, that will move in column, without collision.

#2iQuality

Posted 18 August 2012 - 06:57 AM

Are you wanting to move one object, and then a few seconds later, the next object? Are you wanting a delay/pause in time before each object moves?

Yes, your understand me correctly. But the problem of delay - its stoppes all the "game loop", it will just pause for a while all loop, at as a result it would do nothing except of changing the speed of movement.
Ill explain it in code:

while( n <= objects)
{
array[n].x+=0.02;
SDL_Delay(2000) // the code stoppes for 2 seconds, so the iterations stops too. As a result the 'n = 0' object moves fo "0.02" pixels, then stoppes foe 2 seconds, and after it		// another 'n = 1'object moves for "0.02" pixels and stoppes.
n++;
}

that will move in column one after another

I think this part needs to be explained in a little more detail.

If you want to "see" anything move, you'll have to render your scene after every single displacement. Also, it might help to position your objects in different locations; Right now, they're all initialized to the exact same values, so x and y are set to 0 and 200, respectively.

Yes, with rendering scenes all correct, the problem is with movement objects, like Goran Milovanovic says, I need a delay after all of my objects.
In another word, im making like simple "tower defence game", and i need to generate my enemies, that will move in column, without collision.

#1iQuality

Posted 18 August 2012 - 06:57 AM

Are you wanting to move one object, and then a few seconds later, the next object? Are you wanting a delay/pause in time before each object moves?

Yes, your understand me correctly. But the problem of delay - its stoppes all the "game loop", it will just pause for a while all loop, at as a result it would do nothing except of changing the speed of movement.
Ill explain it in code:

while( n <= objects)
{
array[n].x+=0.02;
SDL_Delay(2000) // the code stoppes for 2 seconds, so the iterations stops too. As a result the 'n = 0' object moves fo "0.02" pixels, then stoppes foe 2 seconds, and after it // another 'n = 1'object moves for "0.02" pixels and stoppes.
n++;
}

that will move in column one after another

I think this part needs to be explained in a little more detail.

If you want to "see" anything move, you'll have to render your scene after every single displacement. Also, it might help to position your objects in different locations; Right now, they're all initialized to the exact same values, so x and y are set to 0 and 200, respectively.

Yes, with rendering scenes all correct, the problem is with movement objects, like Goran Milovanovic says, I need a delay after all of my objects.
In another word, im making like simple "tower defence game", and i need to generate my enemies, that will move in column, without collision.

PARTNERS