xxxxxxxxxx
let mushroom
let mario
let counter = 0
function preload(){
mushroom = loadImage('images.jpg')
mario = loadImage('mario3.jpg')
}
function setup() {
createCanvas(windowWidth, windowHeight);
background(100);
}
function draw() {
background(255)
// image(img,x,y,width,height);
image(mushroom,counter,width/2+sin(millis()/500)*height/4,sin(millis()/500)*50,sin(millis()/500)*50)
push()
translate(counter,width/4)
rotate(sin(millis()/1000)*TWO_PI)
image(mario,0,0,50,50)
pop()
if (counter > width){
counter = 0
}
counter ++
}