The Dink Network

Reply to Re: Taking Dink x and y coordinates

If you don't have an account, just leave the password field blank.
Username:
Password:
Subject:
Antispam: Enter Dink Smallwood's last name (surname) below.
Formatting: :) :( ;( :P ;) :D >( : :s :O evil cat blood
Bold font Italic font hyperlink Code tags
Message:
 
 
June 14th 2012, 09:32 AM
spike.gif
If the wait is only 0 or 1 there shouldn't be variation depending on the speed of the computer. The order things are executed in should usually be independent on processing speed.

Yeah, I agree it's not really unreliable in this case, I was thinking more about what Meta said in the first post and the whole hard corner thing: However, there doesn't seem to be a need to go as far as checking the coordinates after a wait. IE, when you check the XY at first, it comes up as something like 621 0, 20 405, or whatever. So the only thing needed to determine where Dink came from is to check which screen border he went over.

Test script:

void main(void)
{
int &dx = sp_x(1,-1);
int &dy = sp_y(1,-1);
say_xy("X: &dx Y: &dy",0,0)
if (&dx > 619)
say("I came from left!",1)
if (&dx < 20)
say("I came from right!",1)
if (&dy < 0)
say("I came from down!",1)
if (&dy > 399)
say("I came from up!",1)

wait()

int &dx = sp_x(1,-1);
int &dy = sp_y(1,-1);
say_xy("`%X: &dx Y: &dy",0,20)
}


EDIT: Nevermind, you can screw it by walking diagonally at a corner, so that it displays something like 625 -4. Eguurgh.

Can't you just use sp_dir?

I think the diagonal dirs would screw that up, e.g. you can go left by walking southwest, or go down by walking southwest.