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 / Why dosent this work?

Author
Message
Hayer
19
Years of Service
User Offline
Joined: 4th Nov 2005
Location: Norway
Posted: 14th Sep 2006 22:26
Hi..,..
why dosent this s**t work?


Mess with the bests, die like the restes!
Gil Galvanti
19
Years of Service
User Offline
Joined: 22nd Dec 2004
Location: Texas, United States
Posted: 15th Sep 2006 01:04
umm...it works perfectly fine for me...what are you trying to do?

Pirates of Port Royale
Live the life of a pirate.
jinzai
18
Years of Service
User Offline
Joined: 19th Aug 2006
Location: USA
Posted: 15th Sep 2006 03:07
I see two things that might be tripping you up. First, pressing ESC in the game portion will exit your app, not just the game loop. You can disable that behavior, and catch esc presses yourself, then return to the top loop. GOTO has no return equivalent. There is no return from GOTO. That is one reason most people use GOSUB/RETURN instead.

The expletive was really unnecessary. It just doesn't help. You should respect your own work more than that, IMO. I understand your frustration. It is a nice start...it should work. Do those two things, and I think you will be moving along nicely after that.
Hayer
19
Years of Service
User Offline
Joined: 4th Nov 2005
Location: Norway
Posted: 15th Sep 2006 08:39
can u plz expalin u some more?

Mess with the bests, die like the restes!
jinzai
18
Years of Service
User Offline
Joined: 19th Aug 2006
Location: USA
Posted: 15th Sep 2006 11:26 Edited at: 15th Sep 2006 12:12
Well, expletives are curse words, and people don't always appreciate you using them.

Seriously, it seems to me that you are trying to start at the beginning, with an onscreen menu. Press the New Game, and start a new game. Press Load game, and load a game. Then, after you are done pushing the cube around the blank scene, return to the first screen.

So, I copied the code, removed the backslashes, and ran it...although I already knew that I would exit, and not return to the first screen after I pushed the cube around.

So, like the first poster, I am asking you...what is not working about the code?



Take a look at my changes. They look minor, but they are anything but minor. When you arrive at "end" in a Basic program, well...that is the end. As I said, there is no return from goto. goto is an absolute jump to a label.

So, first I made New_Game a subroutine by putting return between the end of the game loop and the end of your program. Next, I replaced the goto with gosub. The escape key disable goes at the start of the area that you want control of the escape key - your game code. At the end, I reenabled escape so that you can still use it to exit the top level menu. Is that what you wanted? Elsewhere, I read a thread that you started about the color of the menu items not changing...that is not an issue in this code, perhaps you mistook the logic error for that?

Finally, if you are going to reenter the code, you need to delete resources. The haphazard handling of objects in DBPro is a habit you had best not start. I deleted your cube and matrix for you. You also should remember the object number, or matrix number, and not use absolute values like that.

Login to post a reply

Server time is: 2024-11-26 12:39:40
Your offset time is: 2024-11-26 12:39:40