Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class Level(object):
- def __init__(self, rows, cols):
- self.levelid = 0
- self.rows = rows
- self.cols = cols
- self.tile_grid = []
- for y in range(self.rows):
- row = []
- for x in range(self.cols):
- row.append(None)
- self.tile_grid.append(row)
- def set_tile(self, tile, v):
- self.tile_grid[tile[1]][tile[0]] = v
- def get_tile(self, x, y):
- return self.tile_grid[y][x]
- def load(self, group):
- group.empty()
- print self.tile_grid[0]
- for y in self.tile_grid:
- for x in self.tile_grid[y]:
- if x != None: group.add(Tile((x, y), tile_grid[y][x]))
Add Comment
Please, Sign In to add comment