- Posted by Brian Jackson <bjackson at PRINTINGINC.COM> Sep 29, 1998
- 2021 views
snortboy wrote: > how do programmers set up large progs so that it all > comes together when you actually punch out the code? Two words. Modular programming. What that means is when I write a game, I start with a basic loop that ends when the player presses the ESC key. Everything else goes on inside of here. I generally use what Rob refers to as "Bottom-up" programming, but I like to call it "seat-of-yer-pants". Then I fit the pieces in one at a time, usually starting with the good guys first, then the levels and backgrounds, and save the bad guys for last. That way, once a particular piece of code takes shape, I just make it a function and refer to it from my original loop. I think this has 2 advantages. First, I'm usually pushing my programming skills to the limit when I start a game, so I need to play around with an idea as a standalone piece of code before I can incorporate it into my program. Secondly, when I am finished coding, my loop is a perfect outline of what's going on in the program- and since I don't make very good comments, this has saved my butt several times. So when something goes wrong, I can just comment out 1 function call instead of 200 lines of code, and test to see if that particular function is faulty. I am currently working on a game, so I'd be more than happy to exchange ideas with anyone else who has done the same type of thing. Deuce bjackson at printinginc.com