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 / recreating dbMoveObject

Author
Message
shiny
19
Years of Service
User Offline
Joined: 17th Jan 2004
Location: Santa Monica
Posted: 17th May 2005 16:04
how would I create a function like dbMove Object, that when called, automaticly calls itsself a certain number of times per second untill the operation it was told to do is finnished? Is it possible?

Thanks!

shiny
19
Years of Service
User Offline
Joined: 17th Jan 2004
Location: Santa Monica
Posted: 19th May 2005 07:18
Oh woops! I didn't realize that dbMoveObject doesn't actualy apply over multiple frames. Either way, the principal stands... how would I create a function that when called, automaticly calls itself untill it has performed its job?

Thanks, sorry for the confusion.

IanM
Retired Moderator
20
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 19th May 2005 08:38
You can't. You'll have to call the function each frame to move it, even if you hide it in a wrapper for the dbSync function.

The way I'd do it -
Create a class that will hold destination coords, speed and an object number, then call a 'move' member function to adjust the objects coords until it reaches the destination.

How I'd get that class created or called would depend very much on the structure of the rest of the program, but it could be something as simple as having a list of pointers to that class, and an automatic update of all objects pointed to by that list being updated in a sync wrapper.

*** Coming soon - Network Plug-in - Check my site for info ***
For free Plug-ins and source code http://www.matrix1.demon.co.uk
shiny
19
Years of Service
User Offline
Joined: 17th Jan 2004
Location: Santa Monica
Posted: 19th May 2005 08:55
Yeah! I thought as much. Thanks!

A shame though.... I loved being able to make functions like that in flash actionscript.

IanM
Retired Moderator
20
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 19th May 2005 21:07
That will do exactly the same as I described - it's just hidden from you. Details may differ, but the basic idea will be identical.

*** Coming soon - Network Plug-in - Check my site for info ***
For free Plug-ins and source code http://www.matrix1.demon.co.uk

Login to post a reply

Server time is: 2023-02-06 18:31:00
Your offset time is: 2023-02-06 18:31:00