SOURCE

console 命令行工具 X clear

                    
>
console
let moveBallA
function setup(){
    createCanvas(300,150)
    background(200)
    ellipseMode(CENTER)
    moveBallA = new MoveBall(random(0),random(0),random(50,50),random(0),)
}
function draw(){

}
class MoveBall{
    constructor(ballx,bally,ballSize,ballColor,ballSpeedx,ballSpeedy)
    this.ballx=ballx
    this.bally=bally
    this.ballSize=ballSize
    this.ballColor=ballColor
    this.ballSpeedx=ballSpeedx
    this.ballSpeedy=ballSpeedy
}
drawing(){
    push()
    fill(this.ballColor)
    ellipse(ballx,bally,this.ballSize,this.ballSize)
}
<script src="https://cdnjs.cloudflare.com/ajax/libs/p5.js/1.1.9/p5.min.js"></script>