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.

Dark GDK / goto return equivalent?

Author
Message
zapakitul
17
Years of Service
User Offline
Joined: 1st Mar 2007
Location: In my world
Posted: 31st Dec 2008 08:30
Recently i started "porting" a game a did a while ago from DBPro to GDK and i got most if it working but i have run across a problem: I had a ball that was moving inside the screen, if the ball left the screen all i had to do is check its position and then i would have jumpted to a label called resetball wich was outside the main loop

But now i can't do this is gdk! I know there is a goto, and i have a label called resetball but if i put the label in the loop the ball will get reseted everytime, if i put it after the main loop the game will reach the return; and the game will exit... Any ideas what to do?
Carlos
20
Years of Service
User Offline
Joined: 26th Mar 2004
Location:
Posted: 31st Dec 2008 12:31
You better use a flag to indicate the resetting of the ball:
jason p sage
17
Years of Service
User Offline
Joined: 10th Jun 2007
Location: Ellington, CT USA
Posted: 31st Dec 2008 18:36
Yeah or make a function that JUST resets the ball.
--Jason

Lilith
16
Years of Service
User Offline
Joined: 12th Feb 2008
Location: Dallas, TX
Posted: 1st Jan 2009 22:18
How about making the ball reset a function rather than a goto.

Lilith, Night Butterfly
I'm not a programmer but I play one in the office
jason p sage
17
Years of Service
User Offline
Joined: 10th Jun 2007
Location: Ellington, CT USA
Posted: 1st Jan 2009 22:42
Yeah I made that recommendation last year <giggle>

Login to post a reply

Server time is: 2024-11-25 09:51:56
Your offset time is: 2024-11-25 09:51:56