/ Published in: ActionScript
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
dx = mouseX - sprite.x; dy = mouseY - sprite.y; sprite.rotation = Math.atan2(dy, dx) * 180Â / Math.PI;