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 / Functions

Author
Message
TyroN
16
Years of Service
User Offline
Joined: 3rd Apr 2008
Location: Canada
Posted: 5th Apr 2008 06:29
ok i switched from blitz3d to Dark GDK, so now im trying to make functions like i used to make in b3d.

For example i did:


The thing is how would i go about making a function that kinda way in GDK.

I know its not gonna be the same because your working in c++, but any examples would help.

dark coder
21
Years of Service
User Offline
Joined: 6th Oct 2002
Location: Japan
Posted: 5th Apr 2008 08:25
Rye
21
Years of Service
User Offline
Joined: 30th May 2003
Location: United Kingdom, Blackrod
Posted: 5th Apr 2008 08:43
TyroN
16
Years of Service
User Offline
Joined: 3rd Apr 2008
Location: Canada
Posted: 5th Apr 2008 09:39
Ok thx that helped.
My function is working now, but everytime i press space my camera moves to (0,0,0).

Heres my code:
ErDa
16
Years of Service
User Offline
Joined: 17th Feb 2008
Location:
Posted: 5th Apr 2008 20:31
Quote: "CreateSphere(objects,dbRnd(3),dbRnd(10),dbRnd(10),dbRnd(10));"


Shouldn't this be dbCreateSphere ?
dark coder
21
Years of Service
User Offline
Joined: 6th Oct 2002
Location: Japan
Posted: 5th Apr 2008 20:51
No. If you look up a few lines you will see: void CreateSphere(int objects,float size, float posx, float posy, float posz).

ErDa
16
Years of Service
User Offline
Joined: 17th Feb 2008
Location:
Posted: 5th Apr 2008 20:54
Oh okay, sorry. To fix the camera problem, couldn't you right after if (dbSpaceKey()) get the current camera position, and then after objects+=1, re-position the camera?
dark coder
21
Years of Service
User Offline
Joined: 6th Oct 2002
Location: Japan
Posted: 5th Apr 2008 21:28
Calling the dbAutoCamOff() function should fix it.

Cladius
16
Years of Service
User Offline
Joined: 16th Mar 2008
Location: Limbo
Posted: 6th Apr 2008 05:47
I'm not sure if this will help, but wouldn't it be better if you initialize:

int objects = 1;

or

Login to post a reply

Server time is: 2024-09-29 17:28:37
Your offset time is: 2024-09-29 17:28:37