Design your room so at least ½ screen's width of the beginning is the same as the end, and ½ screen-width of the end is the beginning. If the player's x is less than the actual beginning of the room (not 0), move every instance one room width (not room_width) to the right. Likewise, if the player x is greater than the actual end of the room (again, not room_width), move everything to the left one room width.
Bit more difficult with multiplayer.
so, its a one room, invisible to the player and yes for last questionIs the game world over many rooms or is it all in one room?
Do you want the loop to be completely seamless/invisible to the player? Or is it fine to have a transition (such as a fade to black)?
Are there enemies or objects that move around that might be visible at the end/start?
if x < camera_get_view_width(view_camera[0])/2 {
x += room_width - camera_get_view_width(view_camera[0]);
}
else
if x > room_width - camera_get_view_width(view_camera[0])/2 {
x -= room_width - camera_get_view_width(view_camera[0])
}
move_wrap isn't seamless, it is very garish. It makes more sense with NPCs than the player. The player needs to keep the "view" intact.
And then design your room so the last screen is duplicated at the beginning and the first screen is duplicated at the end.Code:if x < camera_get_view_width(view_camera[0])/2 { x += room_width - camera_get_view_width(view_camera[0]); } else if x > room_width - camera_get_view_width(view_camera[0])/2 { x -= room_width - camera_get_view_width(view_camera[0]) }
The alternative is to use data-based tile placement.
I tried your code and I like how it works, however it is not clean as expected, it has a few pixels lag, how could I solve that? to make it look really cleanmove_wrap isn't seamless, it is very garish. It makes more sense with NPCs than the player. The player needs to keep the "view" intact.
And then design your room so the last screen is duplicated at the beginning and the first screen is duplicated at the end.Code:if x < camera_get_view_width(view_camera[0])/2 { x += room_width - camera_get_view_width(view_camera[0]); } else if x > room_width - camera_get_view_width(view_camera[0])/2 { x -= room_width - camera_get_view_width(view_camera[0]) }
The alternative is to use data-based tile placement.