Skip to content

Instantly share code, notes, and snippets.

@rememberlenny
Created December 24, 2012 14:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rememberlenny/4369507 to your computer and use it in GitHub Desktop.
Save rememberlenny/4369507 to your computer and use it in GitHub Desktop.
Rotate an object so that its front is always facing the direction its moving in. http://visitmix.com/Articles/Translating-CANVAS-with-HTML5
ctxRoot.rotate(Math.atan2(temp.vy, temp.vx));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment