Properly planning a game takes time to learn on your own. It can be one of those things that a programmer has to experience to understand. Unless you have worked for a large company who would obviously have a structure in place on how a game is designed. For an Indie developer this can seem complicated once your game code starts to get over a few hundred lines of code. What I've learned from my game design attempts is that you have to try to separate each part of the game into sections. Try to keep different areas of your game code organized so that if you need to update one area you can do it easily. It's kind of like writing a book. You have to learn how to put it together so that it's organized and well written. Other programmers always say to make sure to put lots of notes in your code so that if someone else needs to update it later they can easily get an understanding how your game code works. This can also help yourself when you need to come back and make changes.