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]))
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
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
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
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)
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))