Surprisingly been struggling to find and answer to which is probably a pretty common question. I’m making a game that is very similar to plant vs zombies (which is a TD) and I need to make it so there is a set time delay until I can place another tower. Quite new to coding and game dev and I’ve no idea how to go about this. Any advice will be appreciated.
That’s going to depend very heavily on the way you design your game. You’re going to need to read up on arrays and the various collection classes (like Lists and Dictionaries). Probably you’d create some type of class that describes all the properties for a certain tower (like this delay information, but other stuff like how much damage it can take and has already taken, for example), then store that in some kind of array or collection, and loop through those lists checking the timeout for each of them.