soundGameboy = loadSound('gameboy.mp3');
soundGamecube = loadSound('gamecube.mp3');
soundWii = loadSound("wii.mp3");
sound3ds = loadSound("3ds.mp3");
soundSwitch = loadSound("switch.mp3");
fontPixel = loadFont("Pixel Game.otf");
cnv = createCanvas(600, 600);
slider = createSlider(0, 1, 0.5, 0.01);
slider.position(225, 300);
btnGameboy = new imageButton("gameboy.jpg", 100 , 100);
btnGameboy.position(30, 150);
btnGameboy.mousePressed(gameboyBtnPressed);
btnGameboy.mouseReleased(gameboyBtnReleased);
btnGamecube = new imageButton("gamecube.jpg", 100, 100);
btnGamecube.position(30, 300);
btnGamecube.mousePressed(gamecubeBtnPressed);
btnGamecube.mouseReleased(gamecubeBtnReleased);
btnWii = new imageButton("wii.jpg", 100, 100);
btnWii.position(30, 450);
btnWii.mousePressed(wiiBtnPressed);
btnWii.mouseReleased(wiiBtnReleased);
btn3ds = new imageButton("3ds.jpeg", 100, 100);
btn3ds.position(450, 450);
btn3ds.mousePressed(EdsBtnPressed);
btn3ds.mouseReleased(EdsBtnReleased);
btnSwitch = new imageButton("switch.jpeg", 100, 100);
btnSwitch.position(450, 300);
btnSwitch.mousePressed(switchBtnPressed);
btnSwitch.mouseReleased(switchBtnReleased);
headerTxt = "Nintendo Museum";
descriptionTxt = "A collection of activation sounds from various generations of Nintendo devices";
currentlyPlayingTxt = "...";
var volume = slider.value();
soundGameboy.setVolume(volume);
soundGamecube.setVolume(volume);
soundWii.setVolume(volume);
sound3ds.setVolume(volume);
soundSwitch.setVolume(volume);
line(180, 180, 180, 500);
line(180, 500, 400, 500);
line(400, 500, 400, 300);
text(descriptionTxt, 20, 70, width - 50);
if (soundGameboy.isPlaying() == true) {
currentlyPlayingTxt = 'You are listening the sound of a Gameboy';
else if (soundGamecube.isPlaying() == true) {
currentlyPlayingTxt = 'You are listening the sound of a Gamecube';
else if (soundWii.isPlaying() == true) {
currentlyPlayingTxt = 'You are listening the sound of a Nintendo Wii';
else if (sound3ds.isPlaying() == true) {
currentlyPlayingTxt = 'You are listening the sound of a 3DS';
else if (soundSwitch.isPlaying() == true) {
currentlyPlayingTxt = 'You are listening the sound of a Nintendo Switch';
currentlyPlayingTxt = '...';
text(currentlyPlayingTxt, 20, height - 30, width - 50);
function gameboyBtnPressed() {
function gameboyBtnReleased() {
function gamecubeBtnPressed() {
function gamecubeBtnReleased() {
function wiiBtnPressed() {
function wiiBtnReleased() {
function EdsBtnPressed() {
function EdsBtnReleased() {
function switchBtnPressed() {
function switchBtnReleased() {