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;
我想使用位移运算符将一个数字乘以 10。 为了尝试,我初始化了x = 1. 然后我分配x = x<<1 + x<<3.This 打印x = 32。 但是当我分配时x = (x<<1
x = 1
x = x<<1 + x<<3
x = 32
x = (x<<1