Posts: 65
Threads: 12
Joined: May 2003
I'm creating a huge game and came to the subject modular programming.
I've read Nathan's article (Pushing the limits of Qb) and Typosoft Tutorial about Modular programming but still it's not clear to me.
What's so positive about modular programming. And how do I use it?
I'm working on an RPG, imagine I wan't a Pixel*Pixel-scrolling Module and a Enmemy-battle module how do I start?
I hope someone can help me and my post is clear to everyone (my englisch is bad)
Posts: 394
Threads: 16
Joined: Jun 2003
modular programming = using functions, subs, or external file
this divides your program into manageable parts. it also allows you to create your own commands
i.e. LoadImage "this.jpg", 1, 1
you won't find commands like that in ordinary QB. by using subs, functions or libraries, greater customization of the language can be acquired.
you can create a new sub/function by using the Edit menu in QB. I think the help file DOES tell you how to use them decently
ammit potato!
Posts: 3,368
Threads: 195
Joined: Jan 2003
I'll offer my own definition:
Modular programming is the idea that programs can be divided into manageable and to a certain degree independent parts that can be put together like... a hamburger.
Peace cannot be obtained without war. Why? If there is already peace, it is unnecessary for war. If there is no peace, there is already war."
Visit www.neobasic.net to see rubbish in all its finest.
Posts: 292
Threads: 31
Joined: Apr 2003
Quote:I'll offer my own definition:
Modular programming is the idea that programs can be divided into manageable and to a certain degree independent parts that can be put together like... a hamburger.
lol. And one of the reasons modular programming is good, is that it's easy to use the same bit of code (subs) multiple times to do common things. Like adding a pickel, for example.
Posts: 3,288
Threads: 167
Joined: Nov 2001
I believe Nathan's article explains it cery well. What exactly do you not understand in the article?
Do you want to split your code into 2 or more modules?
Posts: 309
Threads: 15
Joined: Jul 2003
Rel,
Is this the article you mentioned?
http://faq.qbasicnews.com/?blast=ModularizeIt
It is the only one I found in a quick search of the FAQ.
hrist Jesus came into the world to save sinners, of whom I am first.(I Timothy 1:15)
For God so loved the world, that He gave His only begotten Son,
that whoever believes in Him should not perish, but have eternal life.(John 3:16)
Posts: 3,288
Threads: 167
Joined: Nov 2001
No, its in the articles section, front page of this site ;*)
Posts: 1,845
Threads: 44
Joined: Aug 2002
Posts: 65
Threads: 12
Joined: May 2003
I managed to solve the problem myself.
I figured out that ther was something wrong with my arrays, After 2 hours changing REDIM's in to DIM's and DIM's in to REDIM's and making DIM's and REDIM's $STATIC or $DYNAMIC, my program did what is was programmed for to do.
Thank you all anyway for your help.
Posts: 394
Threads: 16
Joined: Jun 2003
If you're still planning on that HUGE game, I suggest you go with modular progging anyway. It will make things easier for you in the long run, plus you can't be serious about using gosub/gotos. That's all there is without subs -- you might as well use tsr-basic.
ammit potato!