im dumb

BlitzMax Forums/BlitzMax Programming/im dumb

plash(Posted 2007) [#1]
(Mathematically)
How do I find the number of degrees to rotate my image to make it point towards the mouse?


Matty(Posted 2007) [#2]
pseudo code since I don't know blitzmax:

dx#=mousex()-imagexpos()
dy#=mousey()-imageypos()
angle=atan2(dy,dx)

or something along those lines.


plash(Posted 2007) [#3]
Thanks.


dmaz(Posted 2007) [#4]
http://www.blitzbasic.com/Community/posts.php?topic=69789#781315
you want to use the AngleToTarget and the Point functions.