Arts >> Theater >> Comedy

What is the code to Sponge Bobs gone missing part 3?

Sponge Bob's Gone Missing: Part 3

---

Walkthrough:

1. Talk to Squidward; get Squidward's hat.

2. Go to Sandy's treedome; get Sandy's toolbox.

3. Go to Mr. Krab's; get the key.

4. Go to the Chum Bucket; unlock Plankton's door; put on the hat; retrieve the sponge.

Code:

```javascript

// get the hat

const squidward = document.getElementById('squidward');

const squdwardHat = document.getElementById('hat');

squidward.addEventListener('click', function () {

player.inventory.push(squidwardHat);

squidwardHat.classList.add('hidden');

});

// get the toolbox

const sandy = document.getElementById('sandy');

const sandysToolbox = document.getElementById('toolbox');

sandy.addEventListener('click', function () {

if (player.inventory.includes(squidwardHat)) {

player.inventory.push(sandysToolbox);

sandysToolbox.classList.add('hidden');

} else {

// show a message to the player that they need to get the hat first

}

});

// get the key

const mrKrabs = document.getElementById('mr-krabs');

const mrKrabsKey = document.getElementById('key');

mrKrabs.addEventListener('click', function () {

if (player.inventory.includes(sandysToolbox)) {

player.inventory.push(mrKrabsKey);

mrKrabsKey.classList.add('hidden');

} else {

// show a message to the player that they need to get the toolbox first

}

});

// use the key to unlock the door

const chumBucket = document.getElementById('chum-bucket');

const planktonDoor = document.getElementById('plankton-door');

chumBucket.addEventListener('click', function () {

if (player.inventory.includes(mrKrabsKey)) {

planktonDoor.classList.remove('locked');

} else {

// show a message to the player that they need to get the key first

}

});

// put on the hat and retrieve the sponge

const plankton = document.getElementById('plankton');

const sponge = document.getElementById('sponge');

plankton.addEventListener('click', function () {

if (player.inventory.includes(squidwardHat)) {

sponge.classList.remove('hidden');

} else {

// show a message to the player that they need to get the hat first

}

});

```

Comedy

Related Categories