Example #1
0
    def __init__(self):
        pygame.init()
        pygame.mixer.pre_init(44100, 16, 2, 4096)
        self.settings = Settings()
        self.settings.start_intro_music()
        self.screen = pygame.display.set_mode((self.settings.screen_width, self.settings.screen_height))
        pygame.display.set_caption("Pacman Portal")
        self.clock = pygame.time.Clock()
        self.radius = 1
        self.start = 1
        self.end = 10
        self.begin = pygame.time.get_ticks()
        self.wait = 800

        self.startup = Start(self.screen, self.settings)
        self.stats = Stats(self.settings)
        self.sb = Scoreboard(self.settings, self.screen, self.stats)

        self.maze = Maze(self.screen, mazefile='images/pacman_portal_maze.txt',
                         brickfile='square', orangeportalfile='portal_orange', blueportalfile='portal_blue',
                         shieldfile='shield', pointfile='point_pill', gatefile="gate")
        self.pacman = Pacman(self.screen, mazefile='images/pacman_portal_maze.txt')

        self.red = Red(self.screen, mazefile='images/pacman_portal_maze.txt')
        self.blue = Blue(self.screen, mazefile='images/pacman_portal_maze.txt')
        self.orange = Orange(self.screen, mazefile='images/pacman_portal_maze.txt')
        self.pink = Pink(self.screen, mazefile='images/pacman_portal_maze.txt')
        self.inc = 0
Example #2
0
    def create_ghost(self):
        self.red = Red(self.screen, self.stats, self.pacman, self.sb,
                       self.maze)

        self.red.centerx = self.screen_rect.left - 100
        self.red.rect.centery = self.screen_rect.centery

        self.red.index = 4

        self.blue = Blue(self.screen, self.stats, self.pacman)

        self.blue.centerx = self.screen_rect.left - 125
        self.blue.rect.centery = self.screen_rect.centery

        self.blue.index = 4

        self.orange = Orange(self.screen, self.stats, self.pacman)

        self.orange.centerx = self.screen_rect.left - 150
        self.orange.rect.centery = self.screen_rect.centery

        self.orange.index = 4

        self.pink = Pink(self.screen, self.stats, self.pacman)

        self.pink.centerx = self.screen_rect.left - 175
        self.pink.rect.centery = self.screen_rect.centery

        self.pink.index = 4
Example #3
0
    def __init__(self):
        pygame.init()
        self.screen = pygame.display.set_mode((735, 800))
        pygame.display.set_caption("Pac-man")
        self.settings = Settings()

        self.radius = 1
        self.start = 2
        self.end = 10
        self.begin = pygame.time.get_ticks()
        self.wait = 800

        self.stats = Stats(self.settings)

        self.pb = Button(self.screen)

        self.maze = Maze(self.screen, 'images/maze.txt', 'images/cube0.png',
                         'images/gate0.png', 'images/dot0.png')

        self.sb = Scoreboard(self.settings, self.screen, self.stats, self.maze,
                             self.pb)

        self.player = Player(self.settings, self.screen, self.stats, self.sb,
                             self.maze)
        self.red = Red(self.screen, self.stats, self.player, self.sb,
                       self.maze)
        self.blue = Blue(self.screen, self.stats, self.player)
        self.orange = Orange(self.screen, self.stats, self.player)
        self.pink = Pink(self.screen, self.stats, self.player)

        self.menu = Menu(self.screen, self.stats, self.sb, self.pb, self.maze)