找到没有角度的X/Y坐标可能是可能的吗?我需要在划痕程序中的目标定位器
我的临时项目:https://scratch.mit.edu/projects/657133771
我需要一个目标定位器的三角测量/三边方程。否则坦克就是愚蠢的。
My scratch project:https://scratch.mit.edu/projects/657133771
i need a triangulation/trilateralation equation for a target locator. otherwise the tank is just stupid.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
尝试使用距离公式(毕达哥拉斯定理)来计算点之间的距离。只需使用:

距离 = sqrt( (x2-x1)^2 + (y2-y1)^2 )
Try using the Distance Formula (Pythagorean Theorem) to calculate the distance between points. Simply use:

distance = sqrt( (x2-x1)^2 + (y2-y1)^2 )
使x和y同时改变。它会产生角度效果,并且你的精灵不必转动。不完全是一个公式,但如果你以正确的方式匹配 x 和 y 的变化,你会得到不同的角度。
Make the x and y change at the same time. It will give an angle effect, and your sprite does not have to turn. Not exactly a formula, but if you match up the x and y changes in the right way, you get different angles.