I'm going to be making my own game soon without using tutorials and just using what I know. What I'm having trouble coming up with is the logic of the game. Things like upgrading weapons and towers, how to make ai detect when theres something in their way, things like that. Are there any books or tutorials that help with this kind of thinking while making a game?
You can google search on the "ideas" and problems and solutions people ran into when they implemented a feature. The tutorials are out there- Youtube videos, websites, forums. There is a bunch. If you never made a game before but have background in programming experience, you can search for the ChernoProject on youtube. It is 2d game programming tutorials. No book or one tutorial by someone gets the job done. You most certainly need to search everywhere and put the pieces you need and found together.
How to think like a programmer. Grab a pencil and paper and start designing. A good design on paper is laid out nicely for the human mind to keep track of the pieces of a larger program and features. Design changes but write a small design, figure out what you know and apply. If you do not know just google search. Google is your friend.
If it is a bug in a feature. Read the last paragraph and trace through where the bug lies in the code. Question what, where, when, why and how is it happening. The 4 W's and 1 H does wonders.
Learn to not give up. You only improve if you persevere. Learn to finish a project and say "I am proud I completed what I wanted in the game."