Point Click Isometric Project (Early Access)


Point and Click Isometric Pathfinding

So, the previous demo used the typical arrow keys to move around the map like in most games; even though the movement was smooth and the code had no bugs, I found that to be honest, with an isometric perspective, point-and-click is the way to go. Here are my reasons for switching to a point-and-click navigation system rather than using a D-Pad or arrow keys to move around in an isometric perspective.

Isometric tiles are "skewed", making collision masks, even with y-sorting sorted out, a bit weird. When moving around with arrow keys, especially when you brush up against a wall, things happen: you either pop out of the y-sort, leaving your sprite cut through the walls if you set up your collision mask in perfect alignment with the wall, there always gaps that make your sprite pop out or cut through the wall or if you set up your collision mask to limit movement through the y-axis using a polygon collision shape 2d, your player brushing up against the wall can "feel" the weird collision shape even though they don't cut through the wall sprite. It never feels right. Notice the weird collision shape for the wall below; I think you get the idea.


Point and Click allows the weird collision shape to work without the player noticing the awkwardness of your collision shape, and even better, using the NavigationRegion2D node that´s new to Godot 4, you can Bake your walkable areas as long as you drop in your StaticBody2D (walls) as children of the NavRegion and make sure you give those static bodies collision shapes that are enabled for the baking process to cook just right. The player character then needs a NavigationAgent2D to detect pathfinding spots to walk to.


This way, you can draw your walkable area, bake it to remove areas with static bodies and even draw within the region for un-walkable areas such as holes in the floor. Here is a snap of the result.


The code for movement is as follows; make sure to download the demo project for more details as I already set up the animation (and, in the future, will implement ray casting to check for pickable items and enemies, etc. )


You can also enable debug mode in your NavigationAgent2D to see the path the player will walk towards visually. Take a look.

Files

FinalSprite v0.4.zip 4.8 MB
21 days ago

Get Isometric Characters (With Godot Demo Project)

Buy Now
On Sale!
50% Off
$2.99 $1.49 USD or more

Leave a comment

Log in with itch.io to leave a comment.