xxxxxxxxxx
24
let fruits;
function preload(){
fruits=loadImage("fruits.png")
}
function setup() {
createCanvas(400, 400);
}
function draw() {
background(220);
let x=floor(random(fruits.width))
let y=floor(random(fruits.height))
let mycolor=color(0);
fruits.loadPixels()
fruits.set(x,y,mycolor)
fruits.updatePixels()
image(fruits,0,0)
//let c=fruits.get(mouseX,mouseY)
//fill(c)
//square(mouseX,mouseY,50)
}