Skip to content

Instantly share code, notes, and snippets.

@cferdinandi
Last active April 27, 2019 14:51
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cferdinandi/dcfa502b5502d9f931be0f28e3d31bf3 to your computer and use it in GitHub Desktop.
Save cferdinandi/dcfa502b5502d9f931be0f28e3d31bf3 to your computer and use it in GitHub Desktop.
Monsters! game project template from https://learnvanillajs.com.

Project Details

Build a game inspired by the movie Monsters, Inc. and loosely based on the old PC game Minesweeper.

Create a three-by-four grid of 12 doors. When the user clicks a door, they'll find one of their monster friends. But behind one door is a human sock. These are dangerous and should be avoided at all costs. Finding it means you lose the game.

If the user finds all 11 monster friends without stumbling onto the sock, they win!

Note: SVG files for the monsters, sock, and door have been included for you.

Considerations

  • How are you going to render the game markup?
  • How will you figure out when someone has found all of the monsters?
  • What will you show when they win? What about when they lose?
  • Will you offer people a chance to play again? If so, how?

Need help?

This project is part of the Vanilla JS Academy.

Display the source blob
Display the rendered blob
Raw
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
<!DOCTYPE html>
<html>
<head>
<title>Project Template</title>
<style type="text/css">
body {
margin-left: auto;
margin-right: auto;
max-width: 40em;
width: 88%;
}
</style>
</head>
<body>
<h1>Monsters!</h1>
<p>Click on a door to find your monster friends. Avoid the sock!</p>
<div id="app">Loading...</div>
<footer class="padding-top">
<p class="text-small text-muted">Icons by <a href="https://thenounproject.com/term/door/311732/">Jamie Dickinson</a>, <a href="https://thenounproject.com/term/monster/184225/">Nicky Knicky</a>, <a href="https://thenounproject.com/term/monster/1510400/">Alvaro Cabrera</a>, <a href="https://thenounproject.com/term/monster/28460/">Eliricon</a>, <a href="https://thenounproject.com/term/monster/82823/">April Yang</a>, <a href="https://thenounproject.com/term/monster/1062009/">tk66</a>, <a href="https://thenounproject.com/term/monster/24990/">Alex WaZa</a>, <a href="https://thenounproject.com/term/monster/37212/">Husein Aziz</a>, and <a href="https://thenounproject.com/term/socks/38451/">Yazmin Alanis</a>.</p>
</footer>
<script>
// Project code...
// The monsters and socks
var monsters = [
'sock!',
'monster1.svg',
'monster2.svg',
'monster3.svg',
'monster4.svg',
'monster5.svg',
'monster6.svg',
'monster7.svg',
'monster8.svg',
'monster9.svg',
'monster10.svg',
'monster11.svg'
];
</script>
</body>
</html>
Display the source blob
Display the rendered blob
Raw
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Display the source blob
Display the rendered blob
Raw
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Display the source blob
Display the rendered blob
Raw
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Display the source blob
Display the rendered blob
Raw
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Display the source blob
Display the rendered blob
Raw
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Display the source blob
Display the rendered blob
Raw
<svg width="81" height="85" xmlns="http://www.w3.org/2000/svg" aria-labelledby="title-monster4"><title id="title-monster4">Monster 4</title><path d="M80.2 49.2c-.4-.9-1.5-1.5-3.6-1.9h-.2c.1-.2.3-.7.9-1.3l1.1-1.1c.4-.3 1.5-1.1 1.7-2.3.1-.6-.1-1.4-1-2.2-.4-.4-.9-.5-1.4-.5-1.6 0-2.8 1.8-4.2 4.2 0 .1-.1.1-.1.2-.3-.6-.5-1.4-.4-1.8.1-.7-.1-1.3-.5-1.8s-1-.7-1.6-.7c-.6 0-1.2.3-1.6.7-.4.5-.6 1.2-.4 1.9.1.6.4 1.2.6 1.7.2.5.4 1 .5 1.3 0 0 0 .1-.3.3-1.7.8-2.2 2-2.4 2.8-.2.8 0 1.7.4 2.5-.8 1-1.9 1.6-3.5 1.6-2.4 0-5.6-1.3-9.4-3.9.1-1.4.2-2.8.3-4.3 1.2.5 2.7.9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1 3.3 1.8.6 3.7.7 5.8.4.1 0 2.1-.3 2.3-.3-.7 2.2-14.3 33-14.3 33.1l-1 1.8h56.5l-1.2-1.9C61 77.3 55.2 61.8 55 57.4c1.6.5 3.6.9 5.7.9s4-.4 5.7-1.3c1.8-.9 3.3-2.3 4.6-4.1 1.4-.1 2.6-1.2 2.7-1.3l.1-.1.1-.1c.2-.2.5-.5.7-.6 1 .7 2.5 1 3.6 1 .3 0 1.4 0 1.9-.8 0-.1.5-.9.1-1.8zM48.6 12.9c.6 0 1 .5 1 1 0 .6-.5 1-1 1-.6 0-1-.5-1-1 0-.6.4-1 1-1zm-3.6-.2c.8 0 1.4.6 1.4 1.4 0 .8-.6 1.4-1.4 1.4-.8 0-1.4-.6-1.4-1.4 0-.8.6-1.4 1.4-1.4zm8.3 6.1H52l-.9 1.8.2-1.8H41.1l-.3 1.6-.5-1.5v-.1h-1.1c-.1 0-.2-.1-.2-.2s.1-.2.2-.2h14c.1 0 .2.1.2.2.2.1.1.2-.1.2z" fill-rule="nonzero" fill="#f42b37"/></svg>
Display the source blob
Display the rendered blob
Raw
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Display the source blob
Display the rendered blob
Raw
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Display the source blob
Display the rendered blob
Raw
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Display the source blob
Display the rendered blob
Raw
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Display the source blob
Display the rendered blob
Raw
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment