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 / Weird Glitch. Trippy Screen

Author
Message
Caleb W
12
Years of Service
User Offline
Joined: 13th Jan 2014
Location:
Posted: 13th Feb 2014 17:36
I am making a game for a school project and I ran into a weird bug. When I go through my Level 1 (The Boat) and fail, and then I select the other Level (The Wagon), the screen derps out and is really weird. does anyone know how to fix this?
Here is the code:
Derek Darkly
14
Years of Service
User Offline
Joined: 22nd Sep 2011
Location: Whats Our Vector, Victor?
Posted: 13th Feb 2014 19:00 Edited at: 13th Feb 2014 19:01
So Level 2 will load normally as long as you don't go to Level 1 first, correct?

If that is the case, look and see what variables both levels have in common and make sure you reset them at the beginning of each level.

(If you provide the media files I will run your program.)

Caleb W
12
Years of Service
User Offline
Joined: 13th Jan 2014
Location:
Posted: 18th Feb 2014 17:20
How would I reset my variables? I am very new at dark basic.
Caleb W
12
Years of Service
User Offline
Joined: 13th Jan 2014
Location:
Posted: 18th Feb 2014 17:20
How would I reset my variables? I am very new at dark basic.
Caleb W
12
Years of Service
User Offline
Joined: 13th Jan 2014
Location:
Posted: 18th Feb 2014 17:20
How would I reset my variables? I am very new at dark basic.
Derek Darkly
14
Years of Service
User Offline
Joined: 22nd Sep 2011
Location: Whats Our Vector, Victor?
Posted: 18th Feb 2014 22:38 Edited at: 18th Feb 2014 23:25
I see the problem...
You're turning your backdrop off and on, which isn't necessary.

Just use BACKDROP ON:SYNC ON:SYNC RATE n at the top of your program and then use SYNC once at the bottom of every loop.
You will want to set your sync rate to something reasonable so it will run at the same speed on all computers. (Around 60 is the rate of the human eye, I think.)

If you don't like the blue screen just color backdrop 0 for black.

Also:

-Use goto Selection or exit instead of gosub for your line if Inkey$()="a" then gosub Selection - gosub is meant only to branch out momentarily to a subroutine rather than a permanent break-away from the loop.

-Collision boxes are not necessary in this case - your collision will be detected on the object itself, which comes with it's own collision box/sphere when you make the object.

-You can use object collision(1,0) to detect collision for all objects (zero is for all) then sort out which are walls and which are dangerous objects, etc., immediately after.

Caleb W
12
Years of Service
User Offline
Joined: 13th Jan 2014
Location:
Posted: 24th Feb 2014 17:08
Thank you! The problem in now fixed! Sorry about the spam above. Was not intentional.

Login to post a reply

Server time is: 2026-07-07 06:43:44
Your offset time is: 2026-07-07 06:43:44