Z
zenoboy
Guest
I have this floor object in game maker and hspeed is -8 & room speed is at 30.
Room size is 1366x1024.
The sprite width used for the floor is 1645px (235px*7times). Sprite origin for X is at 0.
So that means in theory, when the floor reaches -235px I should set it to 0 to give it an illusion that it runs forever.
This is my code for the floor object:
It runs repeatedly but it seems that it gets 1-2px extra movement to the right side.
I've tried changing 'x' and also the condition above but it either ends up making it worse.
It moves to the left side instead sometimes when I changed this code.
I'm probably missing something like maybe changing the room speed?
How do I fix my problem?
Room size is 1366x1024.
The sprite width used for the floor is 1645px (235px*7times). Sprite origin for X is at 0.
So that means in theory, when the floor reaches -235px I should set it to 0 to give it an illusion that it runs forever.
This is my code for the floor object:
Code:
if (x < -235) {
x = 0;
}
I've tried changing 'x' and also the condition above but it either ends up making it worse.
It moves to the left side instead sometimes when I changed this code.
I'm probably missing something like maybe changing the room speed?
How do I fix my problem?