Hi everyone,
please bear with me
I'm not a programmer, and my math is pretty much zero at best
I'm creating this mech shooter platformer,
and I encountered some trouble with the gun aiming in my game
it's not really a big problem really, but the curiosity is eating me
so I created a gun, where the origin of the sprite is at the bottom,
and an image point for spawning the bullet.
I have created an action to set the angle to point to mouse position,
so it looks like this:
<img src="http://i.imgur.com/1NvQQHq.jpg" border="0" />
now, it is working as it should,
but there's a bit problem with the accuracy this way, the gun won't shoot exactly where the pointer at.
So what I need is for the sprite to point from the image point, but still rotate on its origin
so I figured i would need to point the angles toward this position instead:
<img src="http://i.imgur.com/9V24xs6.jpg" border="0" />
is there some way I can retrieve this position using equation?
or can this be achieved in some other way instead?