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 / dbp: kind of recursion question

Author
Message
raar
20
Years of Service
User Offline
Joined: 9th Jul 2004
Location:
Posted: 18th Jan 2005 05:58
Well this is kind of a recursion question only do you not call the same function let me explain:
i coded a menu and if you press on the new button it calls the function gameloop(). This function calls menu again when it ends, so it doesn't return to the menu. Same with the highscore button it calls displayhigh() and if you press oke in that window it calls a new menu.
So will this create a lot of overhead and should i recode it or is it doable this way?
IanM
Retired Moderator
22
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 18th Jan 2005 06:01
Congratulations! You have managed to code a 'goto' using just functions.

Seriously though, why not just return to the menu when you game ends instead of calling the menu? If you join a team (or they join you) no-one will thank you for writing spaghetti code like that.

*** Coming soon - Network Plug-in - Check my site for info ***
For free Plug-ins and source code http://www.matrix1.demon.co.uk
raar
20
Years of Service
User Offline
Joined: 9th Jul 2004
Location:
Posted: 18th Jan 2005 06:09 Edited at: 18th Jan 2005 06:12
yeah i think it became like this because i decided to use functions in the mids of the program (thats never good but it got bigger than i thought)
but i actaully allready started to change it :p and just asked this question to know how "big" yer recursion calls can get in dbp

hehe guess i ll have to think before i begin on my next game :p. But i never thought i was gonna make it so large, but seems i just wanted to try as much as possible in this one :s

Login to post a reply

Server time is: 2024-09-23 09:22:09
Your offset time is: 2024-09-23 09:22:09