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 Professional Discussion / Need Help with going to my second level

Author
Message
Programming Noob
15
Years of Service
User Offline
Joined: 10th Jan 2011
Location:
Posted: 10th Jan 2011 15:04
Hi I'm having some trouble with making my code in my game go to my second level. When I start it the game goes to the intro screen and then it goes down hill from there. I have used this program before but I never tried making two levels before this. I do not know what I'm doing wrong.

I put a link to my code in the attachments.
BillR
23
Years of Service
User Offline
Joined: 19th Mar 2003
Location: United States
Posted: 13th Jan 2011 07:39 Edited at: 13th Jan 2011 07:42
Well...Having all your media in a zip file so we could compile your code to test it might help.

But I can give you a few pointers to try first.
It looks like you just copied the level 1 code and pasted it calling
it MainSection2:, but you never call MainSection2.
Even if you did call MainSection2 you would probably get errors because you
are loading objects using the same object numbers as level1, so a little more thought about design of your code might be in order.

1) Don't have your load media code at the start of your program, instead call a function to load media such as

This function would delete any loaded media from a previous level that isn't needed any more.
It would check to load any media for the requested level, making sure to load objects into unused object numbers, using

for deleting and loading objects as needed.
Hope this helps.
SH4773R
16
Years of Service
User Offline
Joined: 18th Jan 2010
Location: AMERICA!!!
Posted: 13th Jan 2011 07:43
I would post help but billr pretty much nailed it
Programming Noob
15
Years of Service
User Offline
Joined: 10th Jan 2011
Location:
Posted: 18th Jan 2011 15:14
Thanks I got my code to go to my second level now !

Login to post a reply

Server time is: 2026-07-18 02:08:57
Your offset time is: 2026-07-18 02:08:57