Hacker News new | ask | show | jobs
by pjc50 2330 days ago
The classic way to get this accidentally:

- if "forward" key held down, add unit motion vector to position

- if "left" key held down, rotate motion vector to left and add it to the position

In that case, you've added two copies of the vector at 90 degrees to each other, and the player moves by sqrt(2) times the normal speed.