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.

DarkBASIC Discussion / A Simple question

Author
Message
Mystic Trunks
18
Years of Service
User Offline
Joined: 6th May 2007
Location:
Posted: 28th Feb 2008 00:58
I have a simple question, is your entire game made in 1 file... cause this part bothers me the most. I was going to make a 2D RPG and I was wondering if it's possible to do multiple files and just call the file.

Like so.

// if key(Enter)
call test.dba
end

Something like that, I know none of that's right but it's just an example.

DB PROgrammer
18
Years of Service
User Offline
Joined: 9th Feb 2007
Location: Nowhere But Everywhere
Posted: 28th Feb 2008 03:13
Hmm... I know it is in DBPro. I think it might be posible in DBC is there an Include# command? If there is then thats what your looking for. I'm guessing somone else could answer this...


If it was illegal to be stupid we'd run out of room.
KISTech
17
Years of Service
User Offline
Joined: 8th Feb 2008
Location: Aloha, Oregon
Posted: 28th Feb 2008 05:21
Are you just looking to do different levels in individual files instead of dumping it all in one, and going to "suchandsuch" section when it's time for that level?


Don't think, just code.
TDK
Retired Moderator
22
Years of Service
User Offline
Joined: 19th Nov 2002
Location: UK
Posted: 28th Feb 2008 09:08
Quote: "is there an Include# command?"


Yes, but that isn't what he's after. I think KISTech is on the right track.

Mystic Trunks:

What you would do is create files for each level which describe how a level is built. In your game, you have a variable which you stores the current level and increment it when a level is completed.

You also have a 'general purpose' level building procedure (or function) which uses the current level number to load the level file and build the next level.

This can be a text file which lists all the objects to load along with where they are placed, variable settings and that sort of stuff.

These files can be called Level001.dat, Level002.dat and so on. That way, if you have just completed level 7, then you know the next level is 8 and you have to load Level008.dat to find out how to create the next level.

TDK_Man

Login to post a reply

Server time is: 2025-06-04 02:07:30
Your offset time is: 2025-06-04 02:07:30