Beispiel #1
0
 def __init__(self, gameboard, position, speed):
     Obstacle.__init__(self,
                       self._load_image(gameboard),
                       gameboard,
                       position,
                       speed)
     self.effects.append(VerticalTrail(self, self.gameboard))
     self.last_x = self.x
     self.amplitude = random.randint(30,120)
Beispiel #2
0
    def __init__(self, x, y, width, height, vel_x, gap, color):
        Obstacle.__init__(self, x, y, width, height, vel_x, color)

        # Make sure the gap can always be seen
        screen_height = pygame.display.Info().current_h
        if (height + gap) > screen_height:
            height = screen_height - gap
        top = Platform(x, y, width, height, vel_x, color)

        # Make sure the bottom half of the pipe always takes up the rest of the height of the screen
        bottom_y = y + gap + height
        bottom_height = screen_height - bottom_y
        bottom = Platform(x, bottom_y, width, bottom_height, vel_x, color)
        self.__pipes = [top, bottom]
Beispiel #3
0
    def __init__(self, x, y, width, height, vel_x, gap, color):
        Obstacle.__init__(self, x, y, width, height, vel_x, color)
        mid_height = randint(0, 150)

        # Make sure the gap can always be seen
        screen_height = pygame.display.Info().current_h
        if (height + (gap * 2) + mid_height) > screen_height:
            height = screen_height - (gap * 2) - mid_height
        top = Platform(x, y, width, height, vel_x, color)

        mid_y = y + gap + height
        mid = Platform(x, mid_y, width, mid_height, vel_x, color)

        # Make sure the bottom of the pipe always takes up the rest of the height of the screen
        bottom_y = mid_y + gap + mid_height
        bottom_height = screen_height - bottom_y
        bottom = Platform(x, bottom_y, width, bottom_height, vel_x, color)
        self.__pipes = [top, mid, bottom]
Beispiel #4
0
 def __init__(self, gameboard, position, speed):
     Obstacle.__init__(self,
                       self._load_image(gameboard),
                       gameboard,
                       position,
                       speed)
Beispiel #5
0
 def __init__(self, x, y, width, height, vel_x, color):
     Obstacle.__init__(self, x, y, width, height, vel_x, color)