Lichter zum Leuchten bringen
This commit is contained in:
parent
753cb75b1d
commit
8369f3d4de
Binary file not shown.
|
@ -64,8 +64,11 @@ if __name__ == "__main__":
|
|||
collisions = pygame.sprite.spritecollide(player.sprite, detectors, False)
|
||||
for detector in collisions:
|
||||
for lantern in lanterns:
|
||||
if lantern.id == detector.id - 1 and lantern.id is not 8 or lantern.id == detector.id + 1 and lantern.id is not 8:
|
||||
lantern.light_up(176, 179, 0)
|
||||
if lantern.id == detector.id:
|
||||
lantern.light_up()
|
||||
lantern.light_up(255, 255, 0)
|
||||
|
||||
|
||||
if pygame.sprite.spritecollide(player.sprite, streets, False):
|
||||
player.sprite.set_back()
|
||||
|
|
|
@ -53,8 +53,8 @@ class Lanterns(pygame.sprite.Sprite):
|
|||
self.rect = self.image.get_rect(center=(left, top))
|
||||
self.id = id
|
||||
|
||||
def light_up(self):
|
||||
self.image.fill((255, 255, 0))
|
||||
def light_up(self, r, g, b):
|
||||
self.image.fill((r, g, b))
|
||||
|
||||
def reset_light(self):
|
||||
self.image.fill((0, 0, 0))
|
||||
|
|
Loading…
Reference in a new issue