Quote:
|
Originally Posted by ApothiX
My car is 8 tiles by 11 tiles at direction 0, and the equation I tried was:
PHP Code:
dx = (x+(8+vecx(prevdir)*3)/2) - playerx;
dy = (y+(8+vecy(prevdir)*3)/2) - playery;
playerx = (x+(8+vecx(dir)*3)/2) + dy + vecy(dir)*3;
playery = (y+(8+vecy(dir)*3)/2) + dx + vecx(dir)*3;
It works for directions 0 and 1, (which is probably just a coincidence) but the rest it throws the player off to some other position, sometimes not even in the car
|
have you tried debuging so it returns the player postions to say something like the rc? perhaps
PHP Code:
f(created||timeout) {
dx = (x+(8+vecx(prevdir)*3)/2) - playerx;
dy = (y+(8+vecy(prevdir)*3)/2) - playery;
testx = (x+(8+vecx(dir)*3)/2) + dy + vecy(dir)*3;
testy = (y+(8+vecy(dir)*3)/2) + dx + vecx(dir)*3;
sendtonc Debug: #v(testx) #x(testy);
timeout=1;
}