上传者: 39840387
|
上传时间: 2021-12-30 17:18:16
|
文件大小: 2KB
|
文件类型: -
代码片段:
this.newTarget = function() {
return Math.round(Math.random()*(this.radius*2)-this.radius)
}
this.start = 0
this.value = 0
this.radius = options.radius
this.target = this.newTarget()
this.direction = Math.sign(this.target)
this.wander = options.wander
this.speed = options.speed || 1
}