예제 #1
0
 def drawMe(self, camera):
     pos = [[
         self.source[0] * TILESIZE[0] - camera.Left(),
         self.source[1] * TILESIZE[1] - camera.Top()
     ], TILESIZE]
     from Terrain import getTileSubsurface
     if PTRS["EDITORMODE"]:
         pic = self.previewTrap()
     elif self.timer >= 30:
         if (not PTRS["TERRAIN"].canMoveThrough(
             (self.source[0] - 1, self.source[1]), True)):
             x = 2
             y = 1
         elif (not PTRS["TERRAIN"].canMoveThrough(
             (self.source[0], self.source[1] - 1), True)):
             x = 1
             y = 1
         elif (not PTRS["TERRAIN"].canMoveThrough(
             (self.source[0], self.source[1] + 1), True)):
             x = 2
             y = 2
         else:
             x = 1
             y = 2
         if self.timer <= 40 or self.timer > 48:
             x += 2
         pic = getTileSubsurface("Traps", x, y)
     else:
         pic = getTileSubsurface("Traps", 0, 0)
     camera.getSurface().blit(pic, pos)
예제 #2
0
 def drawMe(self, camera):
     variation = 0
     if (not PTRS["TERRAIN"].canMoveThrough(
         (self.source[0], self.source[1] + 1))
             or not PTRS["TERRAIN"].canMoveThrough(
                 (self.source[0], self.source[1] - 1))):
         variation = 1
     pos = [
         self.source[0] * TILESIZE[0] - camera.Left(),
         self.source[1] * TILESIZE[1] - camera.Top()
     ]
     from Terrain import getTileSubsurface
     if self.activated or self.unitHasKey:
         if PTRS["EDITORMODE"]:
             pic = getTileSubsurface("Traps", 1, 0)
         else:
             pic = getTileSubsurface("Traps", 0, 0)
     else:
         pic = getTileSubsurface("Traps", 0, 1 + variation)
     camera.getSurface().blit(pic, pos)
     if self.key != 0 and (PTRS["EDITORMODE"]
                           or not self.activated and not self.unitHasKey):
         pos = [
             pos[0] + TILESIZE[0] / 2 - lockPics.get_width() / 2,
             pos[1] + TILESIZE[1] / 2 - lockPics.get_width() / 2
         ]
         pic = lockPics.subsurface(
             ((0, (self.key - 1) * lockPics.get_width()),
              (lockPics.get_width(), lockPics.get_width())))
         camera.getSurface().blit(pic, pos)
예제 #3
0
 def drawMe(self, camera):
     variation = 0
     pos = [[
         self.source[0] * TILESIZE[0] - camera.Left(),
         self.source[1] * TILESIZE[1] - camera.Top()
     ], TILESIZE]
     from Terrain import getTileSubsurface, tilesetLookup
     if PTRS["EDITORMODE"]:
         pic = self.previewTrap()
     elif not self.activated:
         tileset = tilesetLookup(PTRS["TERRAIN"].getAtCoord(
             (self.source[0], self.source[1]), 0))
         pic = getTileSubsurface(tileset, 1, 0)
     else:
         pic = getTileSubsurface("Traps", 0, 0)
     camera.getSurface().blit(pic, pos)
예제 #4
0
 def drawMe(self, camera):
     pos = [[
         self.source[0] * TILESIZE[0] - camera.Left(),
         self.source[1] * TILESIZE[1] - camera.Top()
     ], TILESIZE]
     from Terrain import getTileSubsurface
     if PTRS["EDITORMODE"]:
         pic = self.previewTrap()
     elif self.timer >= 35:
         x = 4
         y = 0
         if self.timer <= 42 or self.timer > 48:
             x = 3
             y = 0
         pic = getTileSubsurface("Traps", x, y)
     else:
         pic = getTileSubsurface("Traps", 2, 0)
     camera.getSurface().blit(pic, pos)
예제 #5
0
 def previewTrap(self):
     from Terrain import getTileSubsurface
     return getTileSubsurface("Traps", 5, 0)
예제 #6
0
 def previewTrap(self):
     from Terrain import getTileSubsurface, tilesetLookup
     return getTileSubsurface("Traps", 6, 0)