Good whatever time of day! I have some sprite:
A
point has coordinates Actor.x; Actor.y
.
AB length = 96
BC length = 86
AC length = 42
All calculations are approximate, I made it with help the ruler in Photoshop.
Sprite always towards mouse, angle (in radians) stores in Actor.direction
variable. I draw sprite with scale 0.3
.
All bullets toward mouse (that is Bullet.direction == Actor.direction
). I need to create bullets in the B
point. How I can calculate coordinates of the B
point with any angle?
UPD
If I will create bullets in the coordinates:
x = Actor.x + 96 * math.cos(Actor.direction) * 0.3
y = Actor.y + 96 * math.sin(Actor.direction) * 0.3
I get it:
Excuse my bad English! It isn't my native language. Thank you in advance!