Godot 4.1 Tower Defense Tutorial - Part 01 (Random Path Generation)
Hi again Godot fans! And FINALLY, welcome to the first part of my tower defense tutorial. I know you have been asking me for a while to do this, and I'm glad to finally get part 1 out to you.
In this part, we'll get started generating a random path from left to right that has a minimum length with all of the tiles orientated correctly. It's a follow along, and you will need some coding experience.
Let me know if anything doesn't make sense, and I'll do my best to respond in the comments!
Please like and subscribe, as this is the fuel from which I draw power to generate more content for you!
Enjoy!
Links:
Source Code in Github: https://github.com/WideArchShark/godot-tower-defense/tree/tutorial_01
Kenney 3D Tower Defense Kit - https://kenney.nl/assets/tower-defense-kit
Timeline
0:00 - Introduction
1:30 - Project creation
2:20 - Import assets from Kenney.nl
5:00 - Creating a path generation script
13:35 - Using the path generator in main
15:25 - Making the path random (1)
19:00 - Visualising the path in 3D
26:40 - Tidying the path generation logic
30:40 - Using the correct tiles in the path!
33:20 - Evaluating tile type and rotation
47:14 - Adding a beginning and end tile
50:20 - Filling in the missing tiles
54:05 - Final polish!
55:40 - Next episode teaser!