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
<svg width="85" height="92" xmlns="http://www.w3.org/2000/svg" aria-labelledby="title-monster2"><title id="title-monster2">Monster 2</title><g fill-rule="nonzero" fill="#daa829"><circle cx="40.748" cy="20.232" r="3.029"/><path d="M84.473 65.435c.171.896-.541 1.323-1.318 1.445-.626.098-2.653.75-2.496-1.687.278.744.885 1.212 1.721 1.002 1.383-.347 2.259-1.395 1.846-2.318-.191.612-.574 1.468-1.626 1.456-.825-.011-1.789.208-1.581-1.534.042.482.263.771.643.787.657.029 1.988-.359 1.809-1.31-.544.994-.902.812-1.38.772-.366-.03-.78-.432-.571-1.687 2.896-10.971 2.458-25.435-.727-37.033.461-1.509.705-3.082.705-4.698C81.498 9.267 69.447.056 54.583.056c-3.771 0-7.361.594-10.62 1.665a36.79 36.79 0 0 0-3.313-.148c-3.35 0-6.542.445-9.455 1.25a36.584 36.584 0 0 0-3.529-.17C12.386 2.654 0 12.089 0 23.727c0 3.187.929 6.208 2.592 8.916C.721 45.372 2.437 61.06 7.486 71.807l.001.009.016.029c.295.625.599 1.237.917 1.828 1.199 1.955 2.996 1.09 3.929-.441.932-1.531-.134-1.863-.6-2.33.69.594.399 1.373-.133 1.951-.43.467-1.61 2.238-3.003.232.681.41 1.447.399 1.971-.286.865-1.132.898-2.497 0-2.963.232.6.466 1.507-.366 2.151-.652.506-1.269 1.276-2.192-.216.333.352.686.439.994.216.533-.387 1.332-1.519.599-2.151.193 1.117-.199 1.198-.599 1.465-.344.229-1.032.137-1.738-1.444C3.508 56.239 3.403 44.33 4.447 35.19c4.933 5.785 13.487 9.611 23.217 9.611.482 0 .96-.01 1.437-.027 1.696 4.879 7.237 8.518 13.917 8.796-.372 3.512-1.798 11.517-1.705 22.591.1 11.818-1.098 14.248-4.727 15.779 1.064 0 4.594.135 7.259 0-2.064-12.826-1.427-30.77-.235-38.354.078.001.156.004.235.004.638 0 1.267-.031 1.884-.091 1.199 7.534 1.851 25.564-.221 38.441 2.665.135 6.192 0 7.259 0-3.629-1.531-4.828-3.961-4.729-15.779.095-11.226-1.371-19.293-1.718-22.729 7.263-.928 12.804-5.862 12.804-11.811 0-.238-.009-.472-.026-.706 9.31-1.204 16.994-6.059 20.441-12.571 2.092 8.642 3.365 19.92 1.52 33.287v.001a42.83 42.83 0 0 0-.486 1.857l-.004.006-.005.035c-.16.673-.302 1.341-.421 2-.279 2.278 1.665 2.719 3.348 2.101 1.684-.616 1.057-1.541.982-2.196zM46.15 7.877c-2.26-1.721-10.106-2.863-14.328 1.862C34.653 3.703 44.2 4.742 46.15 7.877zm-5.402 2.735c5.314 0 9.621 4.307 9.621 9.62 0 5.313-4.307 9.62-9.621 9.62-5.312 0-9.62-4.307-9.62-9.62a9.62 9.62 0 0 1 9.62-9.62zM28.737 39.808c.745.089 1.55.141 2.402.16.092-1.585.792-2.479 1.701-3.208 1.026.942 1.137 2.393 1.147 3.167.358-.016.72-.037 1.087-.061.341-.891.928-1.477 1.623-1.967.499.517.746 1.153.864 1.755a78.611 78.611 0 0 0 1.915-.219c.292-.478.676-.862 1.106-1.209.312.286.539.617.707.963.72-.105 1.441-.217 2.157-.336.172-.228.362-.442.568-.644.187.138.348.295.49.463 1.555-.273 3.078-.571 4.521-.881.078-.251.187-.502.339-.741.309.136.604.29.881.475a98.614 98.614 0 0 0 1.916-.447 3.171 3.171 0 0 1 .269-1.378c.635.175 1.229.427 1.755.868.216-.057.424-.113.629-.17-.217-.761-.496-2.129.184-3.291 1.062.419 1.979 1.049 2.538 2.476.738-.249 1.285-.466 1.589-.638-5.691 9.723-25.103 7.658-30.388 4.863z"/></g></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.
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