Ejemplo n.º 1
0
f = functions.GameFunctions(g, None)

# Tilesets Setup
tmxdata = tmxdata.TmxData()
maze = maze.Maze(tmxdata)
pellets_template = pellets.Pellets(tmxdata)
pellets = pellets.Pellets(tmxdata)
pellets.reset(pellets_template)
ghost_paths = ghostpaths.GhostPaths(tmxdata)
gobbler_paths = gobblerpaths.GobblerPaths(tmxdata)

# Sprites Setup
gobbler = gobblersprite.GobblerSprite(g, GobblerNavigator(f, gobbler_paths))
ghost_yellow = ghostsprite.YellowGhostSprite(g, VoidNavigator())
ghost_pink = ghostsprite.PinkGhostSprite(g, VoidNavigator())
ghost_cyan = ghostsprite.CyanGhostSprite(g, VoidNavigator())
ghost_red = ghostsprite.RedGhostSprite(g, VoidNavigator())

# Lists setup
all_ghosts = [ghost_yellow, ghost_pink, ghost_cyan, ghost_red]
all_sprites = [gobbler, ghost_yellow, ghost_pink, ghost_cyan, ghost_red]

# Game Loop setup
fps = 60

# Reset all sprites to their starting positions in the maze
for sprite in all_sprites:
    sprite.reset()

# This is the main game loop.  Everything below here repeats forever.
while True:
Ejemplo n.º 2
0
# Tilesets Setup
tmxdata = tmxdata.TmxData()
maze = maze.Maze(tmxdata)
pellets_template = pellets.Pellets(tmxdata)
pellets = pellets.Pellets(tmxdata)
pellets.reset(pellets_template)
ghost_paths = ghostpaths.GhostPaths(tmxdata)
gobbler_paths = gobblerpaths.GobblerPaths(tmxdata)

# Sprites Setup
gobbler = gobblersprite.GobblerSprite(g, GobblerNavigator(f, gobbler_paths))
ghost_yellow = ghostsprite.YellowGhostSprite(g,
                                             RandomNavigator(f, ghost_paths))
ghost_pink = ghostsprite.PinkGhostSprite(g, RandomNavigator(f, ghost_paths))
ghost_cyan = ghostsprite.CyanGhostSprite(g, RandomNavigator(f, ghost_paths))
ghost_red = ghostsprite.RedGhostSprite(g, RandomNavigator(f, ghost_paths))

# Lists setup
all_ghosts = [ghost_yellow, ghost_pink, ghost_cyan, ghost_red]
all_sprites = [gobbler, ghost_yellow, ghost_pink, ghost_cyan, ghost_red]

# Game Loop setup
fps = 60

# Reset all sprites to their starting positions in the maze
for sprite in all_sprites:
    sprite.reset()

# This is the main game loop.  Everything below here repeats forever.
while True: