18 lines
557 B
Python
18 lines
557 B
Python
from survival.image import Image
|
|
from survival.tile import Tile
|
|
|
|
|
|
class TileLayer:
|
|
def __init__(self, width, height):
|
|
self.width = width
|
|
self.height = height
|
|
self.tiles = [[Tile() for x in range(self.width)] for y in range(self.height)]
|
|
self.image = Image('atlas.png')
|
|
|
|
def draw(self, camera):
|
|
for y in range(self.height):
|
|
for x in range(self.width):
|
|
self.image.pos = (x*32, y*32)
|
|
self.image.origin = self.tiles[y][x].origin
|
|
camera.draw(self.image)
|