Can someone help me with this please? I’m trying to make an endless loop for this while statement. At the moment, it moves the sprite forward, then back to start point and stop there. What do I need to do for making an endless loop for this?
while(1)
{
enemy_pan1.pos_x += speed_x;
if (enemy_pan1.pos_x >= 500)
{
enemy_pan1.pos_x = 500;
while(1)
{
enemy_pan1.pos_x -= speed_x;
if (enemy_pan1.pos_x <= 300)
{
enemy_pan1.pos_x = 300;
}
wait(1);
}
}
wait(1);
}