示例#1
0
文件: editor.py 项目: dmeelker/pytank
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))
示例#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)
示例#3
0
文件: editor.py 项目: dmeelker/pytank
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)