【发布时间】:2017-11-03 23:26:25
【问题描述】:
一天中的任何时候都很好!我有一些精灵:
A 点的坐标为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 始终朝向鼠标,角度(以弧度为单位)存储在 Actor.direction 变量中。我用比例绘制精灵0.3。
所有子弹都指向鼠标(即Bullet.direction == Actor.direction)。我需要在B 点创建项目符号。如何计算任意角度的B 点的坐标?
UPD
如果我要在坐标中创建子弹:
x = Actor.x + 96 * math.cos(Actor.direction) * 0.3
y = Actor.y + 96 * math.sin(Actor.direction) * 0.3
我明白了:
请原谅我的英语不好!这不是我的母语。提前谢谢!
【问题讨论】: