ID:1683630
 
Keywords: animate, webclient
Resolved
Back-to-back animate() calls that reset animation on the same tick could cause confusion.
BYOND Version:507
Operating System:Windows Vista Home Basic 64-bit
Web Browser:Chrome 37.0.2062.120
Applies to:Webclient
Status: Resolved (507.1260)

This issue has been resolved.
Webclient 507.1259

Info:

My project uses custom keys set up using winset.

Up = W
Left = A
Right = D


Descriptive Problem Summary:

When holding up(W) to move forward and left(A) or right(D) to turn the player jumps between (0, 0) and its current pixel offset possibly more.

Only happens when moving forward and turning at the same time.

Works in Dream Seeker with no issues.

Source: https://dl.dropboxusercontent.com/u/17935054/ Space%20Wars_src.zip
Looking into this now. The demo shows it in action pretty clearly so it's another issue (gar!) with animating pixel offsets.

Just FYI, you can simplify your code a bit because cos(90-angle) = sin(angle) and vice-versa.
I found the issue and was able to take care of it.

As a note, the method you're using to animate probably isn't ideal. By calling animate() twice, you're essentially saying "Animate this--no wait, animate that instead". The code in DS handled this fairly gracefully because both animations ultimately ended up combined on the same tick, but the server code had to treat this as a transition--where an animation is interrupted partway and a new one is started.

Better practice is to set the transformation matrix and pixel updates in the same animate() call. That wouldn't have triggered this issue. But it's a good thing the issue did trigger in this case, for the sake of finding and fixing the bug.
Lummox JR resolved issue with message:
Back-to-back animate() calls that reset animation on the same tick could cause confusion.