Beispiel #1
0
    def __init__(self, x, y, level, teleport=False):
        super(Goal, self).__init__()
        self._IMAGES = {"blue": engine.image_path("goal-blue.png"), "red": engine.image_path("goal-red.png")}
        self._current_color = random.choice(self._IMAGES.keys())
        self.image = self._set_image()
        self.rect = self.image.get_rect().move(x, y)
        self._player_touch_done = 0
        self.player_touch_required = 3
        self._teleport = teleport

        self.level = level
        self._screen = pygame.display.get_surface()
        self._max_teleportable_x = self._screen.get_width() - self.rect.width
Beispiel #2
0
    def __init__(self, x, y, level, teleport=False):
        super(Goal, self).__init__()
        self._IMAGES = {
            "blue": engine.image_path("goal-blue.png"),
            "red": engine.image_path("goal-red.png")
        }
        self._current_color = random.choice(self._IMAGES.keys())
        self.image = self._set_image()
        self.rect = self.image.get_rect().move(x, y)
        self._player_touch_done = 0
        self.player_touch_required = 3
        self._teleport = teleport

        self.level = level
        self._screen = pygame.display.get_surface()
        self._max_teleportable_x = self._screen.get_width() - self.rect.width
Beispiel #3
0
    def __init__(self, x, y, level):
        super(Octopus, self).__init__()
        self.image = pygame.image.load(engine.image_path("octopus.png")).convert_alpha()
        self.rect = self.image.get_rect().move(x, y)
        self.mask = pygame.mask.from_surface(self.image)
        self.level = level
        self.target = random.choice((self.level.red_player, self.level.blue_player))

        self._screen = pygame.display.get_surface()
Beispiel #4
0
    def __init__(self, x, y, level):
        super(Octopus, self).__init__()
        self.image = pygame.image.load(
            engine.image_path("octopus.png")).convert_alpha()
        self.rect = self.image.get_rect().move(x, y)
        self.mask = pygame.mask.from_surface(self.image)
        self.level = level
        self.target = random.choice(
            (self.level.red_player, self.level.blue_player))

        self._screen = pygame.display.get_surface()
Beispiel #5
0
 def __init__(self, x, y, image_filename):
     super(BasePlatform, self).__init__()
     self.image = pygame.image.load(
         engine.image_path(image_filename)).convert_alpha()
     self.rect = self.image.get_rect().move(x, y)
Beispiel #6
0
 def __init__(self, x, y):
     super(FastFantom, self).__init__(
             x, y,
             [2, 2],
             engine.image_path("fast-fantom-to-left.png"),
             engine.image_path("fast-fantom-to-right.png"))
Beispiel #7
0
 def __init__(self, x, y):
     super(SlowFantom, self).__init__(
             x, y,
             [1, 1],
             engine.image_path("slow-fantom-to-left.png"),
             engine.image_path("slow-fantom-to-right.png"))
Beispiel #8
0
 def _set_image(self):
     image = "bird-0.png" if self._wings_up else "bird-1.png"
     surface = pygame.image.load(
             engine.image_path(image)).convert_alpha()
     return surface if self._to_right else pygame.transform.flip(surface, True, False)
Beispiel #9
0
 def _set_image(self):
     return pygame.image.load(
             engine.image_path(self._image_filename())).convert_alpha()
Beispiel #10
0
 def __init__(self):
     super(Red, self).__init__(engine.image_path("person-red.png"), x=50)
Beispiel #11
0
 def __init__(self):
     super(Blue, self).__init__(engine.image_path("person-blue.png"), x=600)
Beispiel #12
0
 def __init__(self, x, y, image_filename):
     super(BasePlatform, self).__init__()
     self.image = pygame.image.load(engine.image_path(image_filename)).convert_alpha()
     self.rect = self.image.get_rect().move(x, y)
Beispiel #13
0
 def _set_image(self):
     return pygame.image.load(engine.image_path(
         self._image_filename())).convert_alpha()
Beispiel #14
0
 def __init__(self):
     super(Red, self).__init__(engine.image_path("person-red.png"), x=50)
Beispiel #15
0
 def __init__(self):
     super(Blue, self).__init__(engine.image_path("person-blue.png"), x=600)
Beispiel #16
0
 def __init__(self, x, y):
     super(FastFantom,
           self).__init__(x, y, [2, 2],
                          engine.image_path("fast-fantom-to-left.png"),
                          engine.image_path("fast-fantom-to-right.png"))
Beispiel #17
0
 def __init__(self, x, y):
     super(SlowFantom,
           self).__init__(x, y, [1, 1],
                          engine.image_path("slow-fantom-to-left.png"),
                          engine.image_path("slow-fantom-to-right.png"))
Beispiel #18
0
 def _set_image(self):
     image = "bird-0.png" if self._wings_up else "bird-1.png"
     surface = pygame.image.load(engine.image_path(image)).convert_alpha()
     return surface if self._to_right else pygame.transform.flip(
         surface, True, False)