Created
December 24, 2012 14:53
-
-
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
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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