class Pinky(Ghost): imagespl = image_helper(color='p', direction='l') imagespr = image_helper(color='p', direction='r') imagespu = image_helper(color='p', direction='u') imagespd = image_helper(color='p', direction='d') timer_dict = TimerDict(dict_frames={ 'left': imagespl, 'right': imagespr, 'up': imagespu, 'down': imagespd }, first_key='left') def __init__(self, game, v=Vector(1, 0)): super().__init__(game, v=v, grid_pt=game.maze.location(5, 4), grid_pt_next=game.maze.location(5, 5), timer=Pinky.timer_dict, name="Pinky (pink ghost)") self.look_right() def calc_next(self): super().calc_next(['left', 'right', 'straight', 'reverse'])
class Inky(Ghost): imagesbl = image_helper(color='b', direction='l') imagesbr = image_helper(color='b', direction='r') imagesbu = image_helper(color='b', direction='u') imagesbd = image_helper(color='b', direction='d') timer_dict = TimerDict(dict_frames={ 'left': imagesbl, 'right': imagesbr, 'up': imagesbu, 'down': imagesbd }, first_key='left') def __init__(self, game, v=Vector(-1, 0)): super().__init__(game, v=v, grid_pt=game.maze.location(5, 6), grid_pt_next=game.maze.location(5, 5), timer=Inky.timer_dict, name="Inky (blue ghost)") self.look_left() def calc_next(self): super().calc_next(['right', 'reverse', 'left', 'straight'])
class Clyde(Ghost): imagesol = image_helper(color='o', direction='l') imagesor = image_helper(color='o', direction='r') imagesou = image_helper(color='o', direction='u') imagesod = image_helper(color='o', direction='d') timer_dict = TimerDict(dict_frames={ 'left': imagesol, 'right': imagesor, 'up': imagesou, 'down': imagesod }, first_key='left') def __init__(self, game, v=Vector(0, -1)): super().__init__(game, v=v, grid_pt=game.maze.location(5, 5), grid_pt_next=game.maze.location(6, 5), timer=Clyde.timer_dict, name="Clyde (orange ghost)") self.look_down() def calc_next(self): super().calc_next(['straight', 'right', 'reverse', 'left'])
class Blinky(Ghost): imagesrl = image_helper(color='r', direction='l') imagesrr = image_helper(color='r', direction='r') imagesru = image_helper(color='r', direction='u') imagesrd = image_helper(color='r', direction='d') timer_dict = TimerDict(dict_frames={ 'left': imagesrl, 'right': imagesrr, 'up': imagesru, 'down': imagesrd }, first_key='left') def __init__(self, game, v=Vector(-1, 0)): super().__init__(game, v=v, grid_pt=game.maze.location(6, 5), grid_pt_next=game.maze.location(6, 4), timer=Blinky.timer_dict, name="Blinky (red ghost)") self.look_left() def calc_next(self): super().calc_next(['straight', 'left', 'right', 'reverse'])