How to make a Turret defence game ?

How to make a turret defence game, that you can upgrade your weapons, and make buidlings, but also make the AI (computer) ?

First you need to tell us how much you know about programming.

But on general ii would say, plan by iterations. First think about every thing you want in, write each thing on a small paper or in a notepad document. List attributes and functions they need. After that you might want some master files, like GUI or gameLogic or aiHandler. Then you should contruct some simple workFlowCharts where you think about how objects and the gameengine interacts. Then same thing but with usercases, this means that you make a littl eplan what should happen when the turret hit a thing.

Then you start to code the project, i would advice to code by starting from the GUI then implement the hardest feature first. For example make the gui, then make the function to create a turret and make that whole featue semi done before you start on other functions. Rework your design constantly while working so it matches what you have learned while coding.

Also, use psedo code. This mean write functions in comments in english on a level that the comment could be converted to code in any programming language. This helps to make the function more error free since you actually think in the problem domain more and not just the messy code :p. Try to aplit up scripts according to concerns. Example all economic parts of a turret could be in one script and all combat in one. This is known as multi dimensional seperation of concenrs, or just seperation of concerns or the older term subject orientad programming, it is an improvemnt of the ground OOP. This works becouse of the unity3d gameObject act as natural collection of concerns.

Good luck with your game!