So I'm doing the "Your first game" tutorial and I wanted to create loopback for the player. So like if they went off one side they appeared on the other side. My problem is I don't really know how to use modulo so I created an if statement. Is there a way I could use mod to make this cleaner
position.x = fmod(position.x, screen_size.x)
position.y = fmod(position.y, screen_size.y)
if position.x < 0:
position.x = screen_size.x
if position.y < 0:
position.y = screen_size.y