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 / Transition between levels

Author
Message
Veron
17
Years of Service
User Offline
Joined: 22nd Nov 2006
Location:
Posted: 24th Dec 2007 03:29
Hey, long time since i've posted here, but anyway, here goes!

I'm working on an FPS game, and have the first level in place, but what methods would you suggest to have a smooth and easy transition over to the second level? I tried things such as deleting everything from the first level, and then just loading all the stuff for the 2nd level (all in the same source file) but it didn't seem to work, the game just froze when it came time to delete all the 1st level stuff.

I suppose using more than one source file is the answer, but I have no clue on how to do anything with that. :\

Thanks for reading.


Windsept
18
Years of Service
User Offline
Joined: 9th Jun 2006
Location: United States
Posted: 24th Dec 2007 15:10 Edited at: 24th Dec 2007 15:15
Use this function for the object numbers of all of your level objects.


Then when you want to delete the level just use a function like this...

Then load everything for your next level using the free object function. It might not be the best way of doing it but it'll work.

Windsept

EDIT
When you are doing all of the deleting and loading you should load a fancy loading screen to make the transition between levels nice.

Veron
17
Years of Service
User Offline
Joined: 22nd Nov 2006
Location:
Posted: 24th Dec 2007 15:48
Is there a way so I could have each level as a separate .DBA file though? It would be much easier to handle, manage and keep track of, having say 10 2000 line DBA's, or one 20000 line DBA.

And when one level is over, I could just jump straight over to the next DBA, therefore not still being stuck in the same DO-LOOP stuff as if it was one DBA?


Twu Kai
18
Years of Service
User Offline
Joined: 2nd Oct 2005
Location:
Posted: 24th Dec 2007 19:29 Edited at: 24th Dec 2007 19:32
Quote: "s there a way so I could have each level as a separate .DBA file though?"


Yep, there is. When you have finished your first level, save the dba file. Go to the "files" button in the bottom right corner. Click "Add new". When it prompts you to save the file, save it as the file name of the first level. then it will make another window that you can then code your second level into. Also, I think you will have to delete all the objects from the first level either at the end of that dba file, or in the beginning of the second level file. You do this again for the third level, etc.

Edit: Also, the first dba file you include in the main file (the first level file) will go after the first dba file. Then the second included file will go after the second dba file etc. Hope this helps.

Veron
17
Years of Service
User Offline
Joined: 22nd Nov 2006
Location:
Posted: 25th Dec 2007 13:05
Hmm, so how would I get from the first DBA file to the second DBA file? Say if I wanted to begin the 2nd level in a seperate DBA file when I collided with an object, I would put:



Thanks.


Twu Kai
18
Years of Service
User Offline
Joined: 2nd Oct 2005
Location:
Posted: 25th Dec 2007 17:59
I think it would be something like this:


Of course, in the second level, you would have to encase the whole code in a subroutine, for example you would start with "LEVEL_2:" and end with "RETURN". I hope that's clear!

Veron
17
Years of Service
User Offline
Joined: 22nd Nov 2006
Location:
Posted: 26th Dec 2007 09:53
Aha, works perfectly, thanks a lot.


vorconan
17
Years of Service
User Offline
Joined: 4th Nov 2006
Location: Wales
Posted: 26th Dec 2007 12:44
Why don't you use scripts?



Veron
17
Years of Service
User Offline
Joined: 22nd Nov 2006
Location:
Posted: 26th Dec 2007 15:20
I've never really looked into using any scripts in my DBP programming, but perhaps I will in the future. Thanks!


Login to post a reply

Server time is: 2024-09-27 08:31:32
Your offset time is: 2024-09-27 08:31:32