body {
display: flex;
justify-content: center;
align-items: center;
height: 100vh;
margin: 0;
}
let x, y;
let xspeed, yspeed;
let dvd;
function preload() {
dvd = loadImage(‘dvd_logo.png’);
}
function setup() {
createCanvas(windowWidth, windowHeight);
x = random(width);
y = random(height);
xspeed = 5;
yspeed = 5;
}
function draw() {
background(0);
image(dvd, x, y, 100, 100);
x += xspeed;
y += yspeed;
if (x + dvd.width >= width || x = height || y <= 0) {
yspeed *= -1;
}
}
Source Code: https://github.com/oynozan/bouncing-dvd/
Plz sir, what's this app? I don't even know where you're typing these stuffs
Good Work!