xxxxxxxxxx
32
let dogX = 50;
let catX = 50;
function setup() {
createCanvas(600, 400);
}
function draw() {
background(144,238,144,10);
fill(0);
rect(500,0,100,400);
fill(100, 2, 153);
textSize(90);
text('🐶', dogX, 100);
dogX = dogX + random(0,5);
if(dogX > 500){
textSize(60);
text('The Dog Wins!',50,200);
noLoop();
}
text('🙀', catX, 200);
catX = catX + random(0,5);
if(catX > 500){
text('The Cat Wins!', 50,200);
noLoop();
}
}