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
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="88" height="88" xmlns="http://www.w3.org/2000/svg" aria-labelledby="title-monster9"><title id="title-monster9">Monster 9</title><g transform="translate(-1)" fill-rule="nonzero" fill="#1589ca"><circle cx="28.354" cy="19.264" r="1.383"/><path d="M67.932 56.83h21.105c-13.576-13.577-24.678-6.045-28.948-2.021a18.126 18.126 0 0 0-5.092-5.139 11.427 11.427 0 0 0 1.503-5.669c0-.033-.006-.064-.006-.098l6.58-6.58a2 2 0 1 0-2.828-2.828l-4.783 4.783a11.538 11.538 0 0 0-3.904-4.715 16.709 16.709 0 0 0 7.983-7.207 8.347 8.347 0 0 0 2.104.277 8.37 8.37 0 0 0 0-16.738c-.729 0-1.432.103-2.104.277a16.646 16.646 0 0 0-12.503-8.417c.003-.046.014-.091.014-.138a2.053 2.053 0 1 0-4.106 0c0 .047.011.091.014.137a16.64 16.64 0 0 0-12.503 8.417 8.335 8.335 0 0 0-2.104-.277 8.37 8.37 0 0 0 0 16.738c.728 0 1.43-.103 2.103-.277a16.71 16.71 0 0 0 7.982 7.207 11.558 11.558 0 0 0-3.903 4.715l-4.783-4.783a2 2 0 1 0-2.828 2.828l6.58 6.581c0 .033-.006.064-.006.098 0 2.062.55 3.994 1.501 5.668a18.122 18.122 0 0 0-5.091 5.139C25.64 50.784 14.54 43.254.963 56.83h21.105c-5.778 2.112-11.952 7.443-11.952 20.581l17.5-17.501a18.028 18.028 0 0 0-.659 4.773c0 5.657 2.608 10.701 6.684 14.008v5.007a2 2 0 0 0 4 0v-2.555a17.912 17.912 0 0 0 5.358 1.462V86a2 2 0 0 0 4 0v-3.396a17.913 17.913 0 0 0 5.358-1.463v2.557a2 2 0 0 0 4 0v-5.009c4.075-3.307 6.684-8.35 6.684-14.006 0-1.655-.241-3.251-.659-4.773l17.501 17.501c.001-13.138-6.173-18.469-11.951-20.581zm-6.286-43.971a6.406 6.406 0 1 1-.001 12.81 6.406 6.406 0 0 1 .001-12.81zm-33.292 12.81a6.406 6.406 0 1 1 0-12.812 6.406 6.406 0 0 1 0 12.812zm12.298 3.347a1.383 1.383 0 1 1 0-2.766 1.383 1.383 0 0 1 0 2.766zm4.348 0a1.383 1.383 0 1 1 0-2.766 1.383 1.383 0 0 1 0 2.766zm4.348 0a1.383 1.383 0 1 1 0-2.766 1.383 1.383 0 0 1 0 2.766z"/><circle cx="61.646" cy="19.264" r="1.383"/></g></svg>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment