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
Get Katana Kitsune Isometric Sprite & 3D Model SRC
Katana Kitsune Isometric Sprite & 3D Model SRC
An 8 Directional Single Character Fully Animated and Optimized for RPGMaker and any other engine
More posts
- Source Files Are Back! & Big Price Drop.43 days ago
- Purple-Punk Godot Theme48 days ago
- Vroid Source File Added54 days ago
- Katana Kitsune Isometric Sprite Out Now55 days ago
- Summer Sale DiscountJul 07, 2024
- Sprite Templates UpdatedJun 26, 2024
- Point & Click Isometric Project TemplateJun 26, 2024
- Isometric Pixel Art CharactersJun 17, 2024
Leave a comment
Log in with itch.io to leave a comment.