SOURCE

let speed = 5
let a
let x;
let y;
function setup() {
    createCanvas(480, 480)
    colorMode(HSB,360,100,100)
    noStroke()
    x = width / 2
    y = height / 2
    background(255)
}
function draw() {
    a += 10
    rotate(radians(a))
    translate(20, 0)
    x += random(-speed, speed)
    y += random(-speed, speed)
    fill(random(360),100,100)
    triangle(x, y, x, 100, 150, y)
}
console 命令行工具 X clear

                    
>
console