xxxxxxxxxx
let survive
let Died
let beheaded
let Ring
let song;
let img;
let x = 0;
function preload() {
beheaded = loadImage('Beheaded.jpg')
img = loadImage('six.jpg');
Died = loadImage ('Died.jpg')
survive = loadImage ('Survive.jpg')
Ring = loadImage ('Ring.jpg')
song = loadSound('Song.m4a');
}
function setup() {
createCanvas(900, 900);
}
function draw() {
background(920);
image(img, 0,0, mouseX, mouseY);
x++;
image(Ring,150,0, mouseY, mouseX);
x++;
image(beheaded, 350,0, mouseY, mouseY);
image(Died,0,300, mouseY,mouseX);
image(survive, 350,300, mouseX, mouseY);
}
function setup() {
createCanvas(620, 650);
background(855, 900, 600);
}
function mousePressed() {
if (song.isPlaying()) {
// .isPlaying() returns a boolean
song.stop();
} else {
song.play();
}
}