コード例 #1
0
 def renderMap(self):
     if self.layerVis[0] == True:
         for y in range(0, self.dimensions[1]):
             for x in range(0, self.dimensions[0]):
                 if self.grid[0][x][y] != 0:
                     self.mapSurface.blit(
                         util.load_tile(self.tiles[self.grid[0][x][y]][2]),
                         (x * constants.TILESIZE - self.camera[0],
                          y * constants.TILESIZE - self.camera[1]))
     if self.layerVis[1] == True:
         for y in range(0, self.dimensions[1]):
             for x in range(0, self.dimensions[0]):
                 if self.grid[1][x][y] != 0:
                     self.mapSurface.blit(
                         util.load_tile(self.tiles[self.grid[1][x][y]][2]),
                         (x * constants.TILESIZE - self.camera[0],
                          y * constants.TILESIZE - self.camera[1]))
     if self.layerVis[2] == True:
         for y in range(0, self.dimensions[1]):
             for x in range(0, self.dimensions[0]):
                 if self.grid[2][x][y] != 0:
                     self.mapSurface.blit(
                         util.load_tile(self.tiles[self.grid[2][x][y]][2]),
                         (x * constants.TILESIZE - self.camera[0],
                          y * constants.TILESIZE - self.camera[1]))
コード例 #2
0
ファイル: platforms.py プロジェクト: pavelkang/Super-Mario
 def __init__(self, image, xspeed, yspeed, centerPoint):
     pygame.sprite.Sprite.__init__(self, self.containers)
     self.image = util.load_tile(image + '.png')
     self.x = centerPoint[0]
     self.y = centerPoint[1]
     self.rect = self.image.get_rect(topleft = (self.x, self.y))
     self.xspeed = xspeed
     self.yspeed = yspeed
コード例 #3
0
ファイル: platforms.py プロジェクト: pavelkang/Super-Mario
 def __init__(self, image, landable, hittable, centerPoint):
     pygame.sprite.Sprite.__init__(self, self.containers)
     self.image = util.load_tile(image + '.png')
     self.x = centerPoint[0]
     self.y = centerPoint[1]
     self.rect = self.image.get_rect(topleft = (self.x, self.y))
     self.landable = landable
     self.hittable = hittable
コード例 #4
0
ファイル: platforms.py プロジェクト: pavelkang/Super-Mario
 def __init__(self, type, centerPoint):
     pygame.sprite.Sprite.__init__(self, self.containers)
     self.images = []
     self.images.append(util.load_tile('Question Block 1.png'))
     self.images.append(util.load_tile('Question Block 2.png'))
     self.images.append(util.load_tile('Question Block 3.png'))
     self.image = self.images[2]
     self.x = centerPoint[0]
     self.y = centerPoint[1]
     self.oldy = centerPoint[1]
     self.rect = self.image.get_rect(topleft = (self.x, self.y))
     self.frame = 0
     self.hit = False
     self.bouncespeed = 0
     self.bouncing = False
     self.type = type
     self.landable = True
     self.hittable = True
コード例 #5
0
ファイル: platforms.py プロジェクト: pavelkang/Super-Mario
 def __init__(self, pos, vx, vy, ax, ay):
     pygame.sprite.Sprite.__init__(self, self.containers)
     self.vx, self.vy, self.ax, self.ay = vx, vy, ax, ay
     self.images = []
     self.image = util.load_tile('Brick Destroyed World %d.png' % main.BG)
     self.rect = self.image.get_rect(center = pos)
コード例 #6
0
ファイル: platforms.py プロジェクト: pavelkang/Super-Mario
 def __init__(self, centerPoint):
     pygame.sprite.Sprite.__init__(self, self.containers)
     self.image = util.load_tile('Ground.png')
     self.x = centerPoint[0]
     self.y = centerPoint[1]
     self.rect = self.image.get_rect(topleft = (self.x, self.y))