Closed sheenarbw closed 3 months ago
Would you say approximately 40% faster?
Yup, looks like the code fell into one of the classic blunders: increased speed due to hypotenuse.
ppb.features.default_sprites.KeyBoardMovementSprite
does not normalize its direction vector before applying it to the movement equation.
There are methods in the Vector
to perform this normalization.
Also, keep in mind that the zero vector may explode in the math, so you may need to special case that.
The new KeyBoardMovementSprite handles up, down, left and right movements fine, but if you move diagonally it moves much faster.