Hey guys! I have a question. I really want to start going into the Game Development. And I thought, I’m gonna start with a Tower Defense Game. They seem to be really simple and not complicated to script + I want it to be in 2D!
I’ve been watching some Tutorials on the Internet already, many good ones actually! Yet I have one Problem:
All of them are using ‘Tiles’ for placing Turrets. I really dont like that as it takes away the ‘freedom’ choice of the Player on where he wants to put the Towers.
How I want it to be? I think you know Bloons Tower Defense. I literally played BTD5 over and over again. On BTD you can place Turrets ‘everywhere’ except on the Lane where the Bloons are going their way to the ‘Death Point’.
tldr; I want the player to place their Towers wherever they want and not on setted Tiles.
You have a Bar with your Towers. Lets take an Archer for example. He is the first Tower you can place, its the cheapest Tower etc.
Now I buy it.
NOW I want the player to decide by himself where he wants to place the Tower. He can place it everywhere except on the Path where the Enemies Spawn and follow it until they dissapear.
I’m thinking of a blockade which get placed on the Path, which prevent the player from placing Towers on it.
But I dont want any Tiles or any other Object that basicly snaps the Tower onto it. Makes Space limited, which I dont want. I hope you understand what I mean, pure English hehe
So, if you need blocking the path from being placed by the user, you need to detect the placing turret position by raycasting the turret area and determine if the below collider or object is not the path.
The simplest way to do it is to use tags on objects and add “Path” tag to path object and use Raycast to determine if the object below the placing turret does not have “Path” tag.
What about the ‘Free placing of the Towers’ tho.
Since other Tutorials want me to script a Tile or some Object that is an Area where you place a Tower.
This is exactly what I dont want. I want to a free Area, where the player can place Towers except on the blocked Path.