my struggles with making TD




I decided to make a tower defence game, after setting up core elements, I face a problem. How am to implement a tower upgrade system...
I had several ideas such as using arrays, switch statement, and even using text files. the problem with all of this is flexibility. the switch statement was the best idea I could think of, but then I found out incredibly simple system, use variables to point at array index. It's incredibly simple and obvious but i never thought about it. basically it look like this; name = 0, sprite = 1, type = 2; variable = array[name]. it's fixes the problem with arrays not being flexible enough to store data.
then my next problem was fixed when i mad buttons, the problem was if I will store my towers data in to array how I'll know where is my 'to build towers' and where is my upgrades... i could use two separate arrays buy why? i just set in buttons the array index(from where it must start to read) and that's done. same way upgrade button contains specific index of an array. although this system is not perfect it looks okay for now.
thank you for reading.
Files
Get Pain Td
Pain Td
Slow paced Tower Defance
Status | In development |
Author | M_David |
Genre | Strategy |
Tags | No AI, Pixel Art, Singleplayer, Tower Defense |
Languages | English |
Leave a comment
Log in with itch.io to leave a comment.