The Dink Network

heartbeat

January 16th 2004, 03:05 AM
slimeb.gif
pdub
Peasant He/Him
 
I've been looking through the DinkC Reference and can't find what I'm looking for. Is there no 'heartbeat' function? How can I execute a script once every x number of intervals? I'm trying to figure out the movement capabilities of Dink. Can I only move something in one of the 8 directions? Not circular or complex motions using redink1's included trig functions or anything?
January 16th 2004, 08:21 AM
farmer.gif
Beuc
Peasant He/Him France
 
"set_callback_random(char name_of_proc[20], int min, int max);
tells Dink to run this proc inside of the current script every
min + random (max) thousandths of a second."

I think studying Mystery Island's source should be interesting (mainly, the break-all-camera's part).

move and move_stop do the basic moves.
January 16th 2004, 11:28 AM
girl.gif
joshriot
Peasant They/Them United States
keep it real 
i did a lot of this in anarchy halloween party. check out jh/wiz.c for a pretty basic example.
January 16th 2004, 12:54 PM
slimeb.gif
pdub
Peasant He/Him
 
thanks guys. I'll check out the code.
January 16th 2004, 12:56 PM
custom_magicman.gif
magicman
Peasant They/Them Netherlands duck
Mmmm, pizza. 
Yes, it's too bad there aren't sine/cosine functions in Dink, and you'll need floats too. But I guess you could do something sp_mx() and sp_my(). I don't know exactly what they do, but I think it sets the x/y component of the speed of the sprite.

I didn't check redink.exe, but if it has sine/cosine and floats you can make circular movements, setting the sp_x and the sp_y. You'll have to change the sp_dir manually, though.
January 16th 2004, 04:52 PM
custom_king.png
redink1
King He/Him United States bloop
A mother ducking wizard 
Yeah, sp_mx and sp_my are quite useful for circular movements. I used them in a couple areas in FIAT.