Esempio n. 1
0
def initializeMapData(level):
    mapData = level.getMapData()
    for x in range(level.getSize()[0]):
        for y in range(level.getSize()[1]):
            mapTile = mapData[x][y]
            if mapTile != None:

                playfield.setTile(x, y, playfield.Tile(mapTile))
Esempio n. 2
0
def setupPlayfield(data):
    height = len(data)
    width = len(data[0])
    playfield.initialize(width, height)

    for x in range(width):
        for y in range(height):
            tile = createTileFromCharacter(data[y][x])
            playfield.setTile(x, y, tile)
Esempio n. 3
0
def drawTileAtPixel(x, y, tileType):
    tileX = int(x / playfield.blockSize)
    tileY = int(y / playfield.blockSize)

    if playfield.containsTileCoordinates(tileX, tileY):
        playfield.setTile(tileX, tileY, tileType)