Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Newcomers DBPro Corner / Maybe a stupid question but

Author
Message
Tiger Army Never Die
19
Years of Service
User Offline
Joined: 15th Nov 2004
Location:
Posted: 16th Nov 2004 12:36
Hey...there. I got my dark basic pro like a week ago and started working on a 2d shooter and I was just wondering if there is any kind of order for the code in dark basic pro. Like is there any specific order in which you have to list different things like gosubs are declared first then used later or you load all your images first or anything like that. Or is it just trail and error when figuring out which goes first. I dont know if i worded it right so if I don't make any sense then sorry. Thanks.
CattleRustler
Retired Moderator
21
Years of Service
User Offline
Joined: 8th Aug 2003
Location: case modding at overclock.net
Posted: 16th Nov 2004 21:06
Put all your subs and functions at the end of your code after your main loop. Declare your images and objects first, before your main loop. The main loop should usually be sitting somewhere between these two areas - not that there is always a "set forumla", it really depends on the program.


DBP_NETLIB_v1.4.3 DarkTOPIA site coming soon!
Xander
21
Years of Service
User Offline
Joined: 3rd Mar 2003
Location: In college...yeah!
Posted: 17th Nov 2004 01:59
As long as your code executes in the right order, it does not matter how your code is sorted. Just do it however it makes you feel most comfortable, but most people do it like Cattle Rustler suggested.

As long as it works, who cares?

Xander Moser - Bolt Software - Firewall
Tiger Army Never Die
19
Years of Service
User Offline
Joined: 15th Nov 2004
Location:
Posted: 17th Nov 2004 13:04
Alrighty thanks a lot.

Login to post a reply

Server time is: 2024-09-23 05:26:17
Your offset time is: 2024-09-23 05:26:17