- x_pos = x_pos + resolution[0] - step
-
- bk_x_start = x_pos % self.width
- bk_rect = pygame.Rect(bk_x_start, 0, abs(step) if step != 0 else resolution[0], resolution[1])
+ x_pos += resolution[0] - step
+ elif step < 0:
+ x_pos -= step
+ elif step == 0 and x_pos >= 0:
+ # nothing to do if not drawing the initial background
+ return
+
+ bk_x_start = x_pos % self.width if x_pos != -1 else 0
+ bk_rect = pygame.Rect(bk_x_start, 0, resolution[0] if x_pos == -1 else abs(step), resolution[1])