diff options
Diffstat (limited to 'garbage.py')
-rw-r--r-- | garbage.py | 11 |
1 files changed, 7 insertions, 4 deletions
@@ -24,8 +24,8 @@ class Garbage: def update(self): image_center = self.image.get_width()/2 - self.position = [((self.position[0] - randint(0,10) )%self.screen_w), \ - ((self.position[1] - randint(0,10) )%self.screen_h) ] + self.position = [(self.position[0] - randint(0, self.speed) ), \ + (self.position[1] - randint(0, self.speed) ) ] def collides_with(self, other): return self.get_absolute_rect().colliderect(other.get_absolute_rect()) @@ -33,8 +33,11 @@ class Garbage: def draw(self, on_surface): on_surface.blit(self.image, self.position) - def died(self): - return self.position[0] > self.screen_w + def died_x(self): + return self.position[0] < 0 + + def died_y(self): + return self.position[1] < 0 def draw_alert(self, on_surface): on_surface.blit(self.alert_image, self.position) |