Topic was automatically imported from the old Question2Answer platform.
Asked By
Rayu
How do i make a One Screen game with a moving Object (Sprite for example) that when it goes Offscreen it come back from the opposite side from the screen
That wrapf() function takes a specified value (the first argument) and forces it to land within the specified min and max values (the second 2 arguments).
If the specified value is less than the minimum value, the function returns the maximum value. If the specified value is greater than the maximum value, the function returns the minimum value. That’s how the “wrap” works.
So, if you set those screen_min_* and screen_max_* values correctly for your game bounds, something like the above should work.