Java 等距深度(不是钻石)

Java Isometric Depth (not diamond)

所以我有一个简短的问题。我目前正在 java 制作一个小游戏,我想尝试将玩家隐藏在屏幕上的假 3D 对象后面(等轴测图)。不幸的是,我不能 post 一张照片(没有足够的代表)。基本上它是一个 32 x 48 的 3D 块,通过一半颜色较浅而另一半颜色较深,给人一种它是 3D 的错觉。玩家与方块大小相同,可以在这些 'blocks' 的地图上自由移动。如果玩家移动到一个方块后面,它的底部就会隐藏在它后面。当它移动到前面时则相反,覆盖非玩家方块。现在我在 GameMaker Studio 中制作了一个示例程序来测试它。为了让它在 GM 中工作,我为每个精灵制作了一个脚本,它是一行代码:

depth = y * -1

这会导致玩家的底部在移动到方块后面时 'hide' 在方块后面。我在 GM 的 wiki 上对其进行了一些研究,它几乎改变了实例的 'depth'。现在我的问题是,我将如何在 Java 中做这样的事情?

P.S。这是不是的钻石。它处于一个直的 2D 世界中(从前面向下看 45 个物体)。

编辑: 以下是GameMaker版本的一些图片:

Player Outside

Player Inside

了解 drawing isometric worlds。 了解 Java 和 isometric 开发。

感谢Kayaman解决问题:

If you draw your player first, then a wall on the block south of it, the top half of the wall will mask the bottom half of the player. So no, you don't need to draw halves separately. This means of course that you need to draw the player at the same time as the map, so you can't first draw the map and then the player.

仅供将来使用,java 中的分层图像由图像的添加顺序决定。这正是我要找的确切答案。 GM 代码是 GameMaker 设置图像添加到屏幕的顺序的方式。

感谢大家的帮助!