示例#1
0
 def initPacman(self):
     self.pacmanSprite = tmx.SpriteLayer()
     pacmantmx = self.tilemap.layers['pacman'].find('pacman')[0]
     self.pacman = Pacman((pacmantmx.px,pacmantmx.py),self.direction,self.pacmanSprite)
     self.pacman.movespeed = self.movespeed
     self.tilemap.layers.append(self.pacmanSprite)
     self.tilemap.set_focus(1,1)
示例#2
0
 def blindPacman(self):
     if(self.isBlind):
         return
     blindLayer = tmx.SpriteLayer()
     Blind((self.pacman.posx,self.pacman.posy),blindLayer)
     self.tilemap.layers.append(blindLayer)
     self.isBlind = True
示例#3
0
    def __init__(self,tilemap,screen):
        self.screen = screen
        self.tilemap = tmx.load(tilemap, screen.get_size())
        self.sprites = tmx.SpriteLayer()
        start_cell = self.tilemap.layers['wall'].find('wall')[0]
        self.wall = MapTile(start_cell.px,start_cell.py,self.sprites)
        self.tilemap.layers.append(self.sprites)

        for wall in self.tilemap.layers['wall'].find('wall'):
            MapTile()
示例#4
0
    def initGhost(self):
        self.redghostSprite = tmx.SpriteLayer()
        redghostTmx = self.tilemap.layers['ghost'].find('redghost')[0]
        self.redghost = Ghost((redghostTmx.px, redghostTmx.py),GHOSTSPRITE.RED,self.redghostSprite)
        self.tilemap.layers.append(self.redghostSprite)

        self.pinkghostSprite = tmx.SpriteLayer()
        pinkghostTmx = self.tilemap.layers['ghost'].find('pinkghost')[0]
        self.pinkghost = Ghost((redghostTmx.px, redghostTmx.py), GHOSTSPRITE.PINK,self.pinkghostSprite)
        self.tilemap.layers.append(self.pinkghostSprite)

        self.blueghostSprite = tmx.SpriteLayer()
        blueghostTmx = self.tilemap.layers['ghost'].find('blueghost')[0]
        self.blueghost = Ghost((redghostTmx.px, redghostTmx.py), GHOSTSPRITE.LIGHTBLUE, self.blueghostSprite)
        self.tilemap.layers.append(self.blueghostSprite)

        self.orangeghostSprite = tmx.SpriteLayer()
        orangeghostTmx = self.tilemap.layers['ghost'].find('orangeghost')[0]
        self.orangeghost = Ghost((redghostTmx.px, redghostTmx.py), GHOSTSPRITE.ORANGE, self.orangeghostSprite)
        self.tilemap.layers.append(self.orangeghostSprite)
示例#5
0
 def initPowerball(self):
     self.powerballSprite = tmx.SpriteLayer()
     for powerball in self.tilemap.layers['biscuit'].find('powerball'):
         Powerball((powerball.px,powerball.py),self.powerballSprite)
     self.tilemap.layers.append(self.powerballSprite)
示例#6
0
 def initBiscuit(self):
     self.biscuitSprite = tmx.SpriteLayer()
     for biscuit in self.tilemap.layers['biscuit'].find('biscuit'):
         Biscuit((biscuit.px,biscuit.py),self.biscuitSprite)
     self.tilemap.layers.append(self.biscuitSprite)