在Kivy游戏的等距视图

时间:2014-08-26 16:01:12

标签: python kivy isometric

我在Kivy渲染等距游戏时遇到了一些麻烦。

在Pygame中,我成功运行了此代码:

for row in map_data:
    for tile in row:
        cartx = currentTile * tileWidth    #x is the index of the currentTile * the tile width
        carty = currentRow * tileHeight     #y is the index of the currentRow * the tile height

        x = WIN_WIDTH_HALF + (cartx - carty) / 2
        print(x)
        y = WIN_HEIGHT_QUARTER + (cartx + carty) / 4
        print(y)
        print('\n')

        if tile == 1:
            tileImage = wall
        else:
            tileImage = grass

        DISPLAYSURF.blit(tileImage, (x, y)) #display the actual tile
        currentTile += 1
    currentTile = 0
    currentRow += 1

但是现在,我一直在Kivy玩游戏并希望在其中制作一个简单的等距游戏,我很难想到如何用Kv设计语言来表达上述内容。

我是Kivy的新手并且无可否认地仍然找到了* .py和* .kv文件之间的联系,就像在哪里,所以任何建议都将受到赞赏。基本上,我需要与上面的代码相同的功能,但在Kivy中无缝运行。

提前致谢, Ilmiont

0 个答案:

没有答案