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 / Moving to High Score screen on a specific collision

Author
Message
GameDev1475
10
Years of Service
User Offline
Joined: 18th Feb 2014
Location:
Posted: 18th Feb 2014 18:54 Edited at: 18th Feb 2014 23:38
Hello

I'm new to Dark Basic and Dark Basic Pro. I'm making a maze game, the object is to move through it to the exit as quickly as possible. I have a cube at the exit to detect when user is finished, it disappears when sphere collides with it. I have a timer counting down the time from 40 seconds. The problem is, when I try to call the High Score screen just after the collision for the cube at end is set, it doesn't work. It changes the window title, but cls does nothing and the high score screen doesn't come up.

I have four seperate files with my code in it, here is code:









I have been working at this particular error for a week now, and I have tried everything I can think of and find online. I don't know how to sort this out. Any ideas?

Thank you
zeroSlave
14
Years of Service
User Offline
Joined: 13th Jun 2009
Location: Springfield
Posted: 19th Feb 2014 05:14 Edited at: 19th Feb 2014 05:18
Not sure if this would fix it, but you should look into how you have the IF statements structured:

Should be:


Only use the THEN statement when there is only one conditional statement on the same line as the evaluation.
e.g.


Also, I see that you are setting the collision on on the boxes that you are making for the map, but i didn't see you setting them up for the player or exit cube. Not sure if this would affect it as I'm not sure how DBP's internal collision works.

Everybody is a genius. But if you judge a fish by its ability to climb a tree, it will live its whole life believing that it is stupid.
GameDev1475
10
Years of Service
User Offline
Joined: 18th Feb 2014
Location:
Posted: 20th Feb 2014 16:21
Thank you. I sorted out my if statements and change my code a bit and it now works. Instead of object collision I have the following:



Thanks again.
zeroSlave
14
Years of Service
User Offline
Joined: 13th Jun 2009
Location: Springfield
Posted: 22nd Feb 2014 02:08
Yay!

Just FYI, if you really wanted to fancy it up, you could:


Or make your own function that handles this type of data, and you could have triggers all over!:


Happy coding!

Everybody is a genius. But if you judge a fish by its ability to climb a tree, it will live its whole life believing that it is stupid.

Login to post a reply

Server time is: 2024-04-20 06:32:17
Your offset time is: 2024-04-20 06:32:17