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:

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:

I’m hitting a,z,x,s randomly

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

var _idle_count:int = 0
for i in sorted:
if i.get_node("state_machine") == "idle":
_idle_count += 1
if _idle_count == sorted.size():

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

elif _msg.keys().has("reach_target"):
if Grid.coordinate_within_rangev(movable.game_pos + Vector3.DOWN) &&\
Grid.get_game_axisv(movable.game_pos + Vector3.DOWN) == null:

it falls, but then jump to the roof, because when from idle to fall, the msg does not contain direction, and in, 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:

func is_direction_jumpable(direction:Vector3) -> bool:
if direction in [Vector3.UP,Vector3.DOWN]:
return false

var _self_up_coordinate = game_pos + Vector3.UP
if !Grid.coordinate_within_rangev(_self_up_coordinate):
return false
var _self_up_item = Grid.get_game_axisv(_self_up_coordinate)
if _self_up_item != null:
return false

var _self_up_up_coordinate = game_pos + Vector3.UP*2
if !Grid.coordinate_within_rangev(_self_up_up_coordinate):
return false
var _self_up_up_item = Grid.get_game_axisv(_self_up_up_coordinate)
if _self_up_up_item != null:
return false

var _direction_up_axie = game_pos + direction + Vector3.UP
if !Grid.coordinate_within_rangev(_direction_up_axie):
return false

var _direction_up_item = Grid.get_game_axisv(_direction_up_axie)
if _direction_up_item != null:
return false

return true

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:




Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

Introduction into liquibase with spring boot

[OSD600] Contributing to Melisearch’s documentation

Introducing $KCCS Utility Token

Interesting reads — volume #12

Creating websites using jupyter{book}

Survival Guide (7 of 7): Find, Hire & Work with a Software Developer, Successfully!

Memory Management & Rust

Diving Into Cloud Data Warehousing and Big Data with Microsoft Azure

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Fj max

Fj max

More from Medium

Everything You Want to Know About Making Product Demo Video

IVAS AR Research

Let’s understand the Semantic Web

VR Headset- Drives Sensations to the Mouth, Lips, and Tongue