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 / Program Randomly Ending

Author
Message
Flaming Ghost
19
Years of Service
User Offline
Joined: 29th Apr 2005
Location: Um...Right here
Posted: 23rd Feb 2006 01:06
I have a program that is having difficulties. When I run it it just goes in and then it returns to the editer. I attached the game's file, and here's the game's source. I used the debugger to find out which line it stops on, it's line 146, all that line has on it is 'a=object angle y(1)' PLEASE HELP!!!!



LIGHT FRENZY (almost done!)
Best Noobish game ever.

Attachments

Login to view attachments
SimSmall
20
Years of Service
User Offline
Joined: 7th Aug 2004
Location: United Kingdom
Posted: 23rd Feb 2006 16:39
I went round the track 3 times without a problem...

What version of windows are you using?
Flaming Ghost
19
Years of Service
User Offline
Joined: 29th Apr 2005
Location: Um...Right here
Posted: 23rd Feb 2006 23:46 Edited at: 23rd Feb 2006 23:50
Windows XP. Why would that make a difference though?

EDIT: I just tried it. The .exe works just fine, but when I try to run it in dbPro, it doens't work. Any ideas?


LIGHT FRENZY (almost done!)
Best Noobish game ever.
Grog Grueslayer
Valued Member
19
Years of Service
User Offline
Joined: 30th May 2005
Playing: Green Hell
Posted: 24th Feb 2006 10:04
I don't know why it happens but if you reduce the computer controlled cars to 4 it'll work.

Also your use of "gosub" needs to be changed. When you use "gosub" it means that somewhere you'll "return" back to the line after the "gosub".

Your "gosub"s:


If you're going to go to the next line down... there's no need for "gosub" or even the label.



These two "if" statements don't need "gosub rest" because once the "endif" is seen in either of them it goes to the next line in the code. The label isn't needed either.

The proper use of "gosub" is like this:


Make sure to always have a "return". If you use "gosub" after "gosub" without a return the program will eventually crash. If you won't want to "return" use "goto" but it's best to avoid using "goto" because it leads to spaghetti code.

Here's your code with the "gosub"s remed off and the computer cars reduced:



SimSmall
20
Years of Service
User Offline
Joined: 7th Aug 2004
Location: United Kingdom
Posted: 24th Feb 2006 19:50 Edited at: 24th Feb 2006 19:50
Quote: "The .exe works just fine, but when I try to run it in dbPro, it doens't work. Any ideas?"


DB Pro just makes an exe and then immediately runs the exe

Login to post a reply

Server time is: 2024-11-27 03:34:34
Your offset time is: 2024-11-27 03:34:34