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 / gosub for Dark GDK?

Author
Message
dunno
16
Years of Service
User Offline
Joined: 6th May 2008
Location:
Posted: 7th May 2008 02:21
Hello, I'm fairly new to GDK and have been messing around with it for the past week or so.

I found a tutorial for making an 2D game in DB on the forums here and decided to try and convert it over to GDK.
However, the tutorial uses the 'gosub' commands and I can't find an equivalent command for GDK

I've tried using Goto's, but they don't seem to work as well as a gosub..

In short, is there a command similar to the 'gosub' in DB for GDK?
Lilith
16
Years of Service
User Offline
Joined: 12th Feb 2008
Location: Dallas, TX
Posted: 7th May 2008 07:59
A function call is a gosub. Create the function and when you need to, call the functions by name.

Lilith, Night Butterfly
I'm not a programmer but I play one in the office
MikeyK65
17
Years of Service
User Offline
Joined: 14th Dec 2006
Location: Cheltenham, UK
Posted: 7th May 2008 18:05
Hi there

A gosub is an older style of using functions (sub-routines).

With DBPro you now want to use the newer style of functions and call them just with their name (and any associated parameters).

Have a look at a few examples of db pro parameters and it should make it clear how they differ from gosubs... and it's not much different.

Hope this helps
Mike
FERSIS
18
Years of Service
User Offline
Joined: 17th May 2006
Location:
Posted: 7th May 2008 18:44
You can do something like this:
CheatCat
17
Years of Service
User Offline
Joined: 7th Mar 2007
Location: Sweden
Posted: 7th May 2008 21:57
You can use subs in DarkGDK!



But the sub: must be in the function.


Like this. But you should use functions instead of sub, because subs break loops.
Lilith
16
Years of Service
User Offline
Joined: 12th Feb 2008
Location: Dallas, TX
Posted: 7th May 2008 22:12
That's not a sub, it's a label.

Lilith, Night Butterfly
I'm not a programmer but I play one in the office
dunno
16
Years of Service
User Offline
Joined: 6th May 2008
Location:
Posted: 8th May 2008 05:26
Thanks for all the replies!

Got it working perfectly now

Login to post a reply

Server time is: 2024-09-29 19:27:35
Your offset time is: 2024-09-29 19:27:35