Build an isometric 3D game in 2D — #6 Movement adjusting

This is the final part of the 2d/3d(game/engine) conversion used in my puzzle game: Ladder Box, which is available on Steam:

You can find all the textures, scripts in this GitHub repo: https://github.com/fengjiongmax/3D_iso_in_2D

Godot 3.2.x is used in this project, you can check the commits for what’s new in each part of this series.

Limit user input

In the last 5 part of this series, we’ve made all the states working, but we did not limit user input when the movable are moving, so this could happen:

We should be processing user input when all movables are in idle state, let’s do this.

Just add these code at the beginning of send_command function in main.gd:

Beheavior Tweaking

Idle -> fall

Create a board as follows:

And you will see this:

We need to check if movable can fall in idle, add this to the end of the _command in idle.gd:

it falls, but then jump to the roof, because when from idle to fall, the msg does not contain direction, and in jump.gd, move_direcion is default value, which is V3(0,0,0), and we need to check move_direction.

Jumpable check

This can be fixed in movable.is_direction_jumpable:

And the result:

That’s it for this part. If you read all the way through, thank you and congratulation! It took me years to figure out how to make these things work as expected, and make a game out of it. And by the way, the code in the Github repo is wayyy better than the code in Ladder Box.

Hope you can make something fun out of it!

You can find all the textures, scripts in this GitHub repo: https://github.com/fengjiongmax/3D_iso_in_2D