Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
所以,我正在寻找的是一种在距离玩家精灵 30 像素的随机位置生成精灵的方法。我该怎么做?
正如其他人已经告诉您的那样,您至少应该尝试使用代码,否则您正在滥用网站的目的。
尽管如此:
radius = Math.random()*maxRadius; angle = Math.random()*2*Math.PI; x = Math.cos(angle)*radius + x_of_circle_center; y = Math.sin(angle)*radius + y_of_circle_center;