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.

2D All the way! / Stupid Nesting Errors!!!! Can't get my game running

Author
Message
Erusuwasu
20
Years of Service
User Offline
Joined: 21st Sep 2003
Location: Where am I? I think I\'m lost...
Posted: 27th Sep 2003 12:58 Edited at: 27th Sep 2003 13:01
Im currently making a basic Blasterball/Hardball type game as a learning experience before the big stuff, but it's been one problem after another. Currently I've been trying to convert my code into modules or subroutines so that my code is easier to work with.

However, I ran into a nesting error in the process. Here is basically the code I'm working with at the moment which gives me the error



Any and all help is appreciated very much. Please help me out. I'm really stumped on this one. Thanks guys.

I've got DB Classic and PS Skillz and I'm not afraid to use um!
RebirthAnime
21
Years of Service
User Offline
Joined: 11th Oct 2002
Location:
Posted: 27th Sep 2003 13:12
what's the problem with it?? it seems to work fine except that you didn't do the if returnkey() and if spacekey() stuff right because of course it doesn't do what it should when you press it. Basically all I can tell you is that you've made your code more complex than it really needs to be, and change your exit in your if spacekey() to end so it'll actually end the program.

this code is much easier

Erusuwasu
20
Years of Service
User Offline
Joined: 21st Sep 2003
Location: Where am I? I think I\'m lost...
Posted: 27th Sep 2003 22:28 Edited at: 27th Sep 2003 22:29
Ok I changed my code to this:



However, now I'm getting a "RUNTIME ERROR. FILE DOES NOT EXIST" on the line where I use LOOP

The point of the EXIT command was to EXIT the main program loop where the program would then free up system memory then end. After the Subroutine welcome the game would continue to level_one if the user pressed the return key.



I hope that shows what I'm trying to do a little clearer. What I don't understand is when I wasn't useing modules my code worked perfectly. Oh well,

I really hope someone can answer this. It's drivin' me nuts.

I've got DB Classic and PS Skillz and I'm not afraid to use um!
CloseToPerfect
21
Years of Service
User Offline
Joined: 20th Dec 2002
Location: United States
Posted: 28th Sep 2003 00:58
DO
GoSub welcome
GoSub level_one
GoSub level_two
` etc. etc.
LOOP
Gosub delete_resources
END

that looks fine, so I assume your problem has something to do with your routines theirself, maybe or another part of your code. It's hard to guess at all the possible problems without more code to look at. The only thing I can add is that welcome runs every loop cycle and maybe your tring for something different?

CTP
Erusuwasu
20
Years of Service
User Offline
Joined: 21st Sep 2003
Location: Where am I? I think I\'m lost...
Posted: 28th Sep 2003 10:28 Edited at: 28th Sep 2003 10:34
Well, I didn't think I would have to do this but hopefully it will allow you guys to figure out my problem. So here is the code I'm working with (below).

It gives me a Runtime Error at line 40. File does not exist at line 40.

Sorry in advance for the lack of comments, but you should be able to understand everything. It's all laid out in an orderly fashion.

In the loop the program is supposed to go through Subroutine hide_all_sprites then display the start_menu Subroutine. If the user presses Enter the program is supposed continue out of Subroutine start_menu and continue on through view_all_sprites and on to level_one.

I hope that makes sense. THANKYOU so much for your suggestions so far. Hopefully you will be able to solve my problem more easily now.

I've got DB Classic and PS Skillz and I'm not afraid to use um!
CloseToPerfect
21
Years of Service
User Offline
Joined: 20th Dec 2002
Location: United States
Posted: 28th Sep 2003 19:18
there you go, must be a dbpro bug but it works.

CTP
Erusuwasu
20
Years of Service
User Offline
Joined: 21st Sep 2003
Location: Where am I? I think I\'m lost...
Posted: 28th Sep 2003 19:57 Edited at: 28th Sep 2003 19:58
I'm actually using DBC but it still worked! Thankyou very much. I never thought to use Return instead of Exit. It just goes to show how much I still have ahead of me.

THANKYOU AGIAN

I've got DB Classic and PS Skillz and I'm not afraid to use um!
CloseToPerfect
21
Years of Service
User Offline
Joined: 20th Dec 2002
Location: United States
Posted: 29th Sep 2003 04:45
your welcome, anytime.
CTP

Login to post a reply

Server time is: 2024-05-05 13:34:26
Your offset time is: 2024-05-05 13:34:26