First attempt on ghost movement. /JL
This commit is contained in:
14
pman.py
14
pman.py
@@ -7,7 +7,7 @@ from actors.ghost_mode_controller import GhostModeController
|
||||
from hud import HUD
|
||||
from maze import Maze
|
||||
|
||||
__version__ = "0.4.0"
|
||||
__version__ = "0.4.1"
|
||||
|
||||
# Constants
|
||||
HAT_REPEAT_DELAY = 300 # milliseconds before first repeat
|
||||
@@ -62,12 +62,12 @@ class Game:
|
||||
"""
|
||||
offset = 20 # spread out a little bit inside ghost home
|
||||
|
||||
blinky = Blinky((center_position[0] - offset, center_position[1] - offset))
|
||||
pinky = Pinky((center_position[0] + offset, center_position[1] - offset))
|
||||
inky = Inky((center_position[0] - offset, center_position[1] + offset))
|
||||
clyde = Clyde((center_position[0] + offset, center_position[1] + offset))
|
||||
self.blinky = Blinky((center_position[0] - offset, center_position[1] - offset))
|
||||
self.pinky = Pinky((center_position[0] + offset, center_position[1] - offset))
|
||||
self.inky = Inky((center_position[0] - offset, center_position[1] + offset))
|
||||
self.clyde = Clyde((center_position[0] + offset, center_position[1] + offset))
|
||||
|
||||
return pygame.sprite.Group(blinky, pinky, inky, clyde)
|
||||
return pygame.sprite.Group(self.blinky, self.pinky, self.inky, self.clyde)
|
||||
|
||||
def handle_hat_repeat(self):
|
||||
now = pygame.time.get_ticks()
|
||||
@@ -104,7 +104,7 @@ class Game:
|
||||
|
||||
for ghost in self.ghosts:
|
||||
ghost.set_mode(self.current_mode)
|
||||
#ghost.update(maze, pacman)
|
||||
ghost.update(self.maze, self.player)
|
||||
|
||||
self.ghosts.draw(self.screen)
|
||||
pygame.display.flip()
|
||||
|
Reference in New Issue
Block a user