# Center along X
self.x = (self.viewport_width - self.texture_widht) / 2.0
- def draw(self, screen):
- self.y += self.offset
-
# NOTE, we assume that the texture has at least twice the height of the
# viewport
- lastframe_limit = -(self.texture_height - self.viewport_height)
+ self.lastframe_limit = -(self.texture_height - self.viewport_height)
+
+ def draw(self, screen):
+ self.y += self.offset
# Wrap around to cycle seamlessly
- self.y %= lastframe_limit
+ self.y %= self.lastframe_limit
screen.blit(self.texture, (self.x, self.y))