Coder Social home page Coder Social logo

vanessasue27 / project-cluedo Goto Github PK

View Code? Open in Web Editor NEW

This project forked from technigo/project-cluedo

1.0 0.0 0.0 2.33 MB

Project Cluedo for Technigo's coding bootcamp - Create a piece of the classic board game Cluedo ๐Ÿ‘ฉโ€๐Ÿ’ป๐Ÿ•ต๏ธโ€โ™€๏ธ Pracitce creating objects and arrays and also connect this to the DOM ๐Ÿ’ฅ

JavaScript 61.26% HTML 14.90% CSS 23.84%

project-cluedo's Introduction

Cluedo - Mystery Randomizer

This project's goal is to create a piece inspired in the classic board game Cluedo ๐Ÿ•ต๏ธโ€โ™€๏ธ. The user should be able to click on three decks of cards to randomly get: a killer, a weapon and a room. Then there should also be a button to "reveal" the mystery ๐Ÿ™ˆ

The focus on this project is to practice objects and arrays and also to manipulate the DOM with JavaScript ๐Ÿ‘ฉโ€๐Ÿ’ป๐Ÿ’ช

How I built it - What I learned

  • I've built the three card decks as arrays of objects (in the case of the killer and weapon deck) and the rooms deck is a basic array of different location names. When the user clicks on a card, a function is called which will randomly pick an element from each of the arrays: this will determine who the killer is, which weapon was used and in which room the murder took place. The mystery will always vary...
  • I've added a function to generate at random a killer's favorite weapon. This one will be chosen from a manipulated array in which I've added the killer's favorite weapon's name three extra times, so that the chances of their favorite weapon being chosen are higher. For this, I've used a basic randomizer function and the push() method ๐Ÿ’ก
  • Once the three cards have been picked, there's a button for revealing the crime, which is done by manipulating the DOM with JavaScript; and I've also added a Restart button, so the user can have a go at it again ๐Ÿ˜
  • I'm especially proud of the loaders which I've added once a card is clicked to give the impression that the choice is being generated. I've managed this by using the setTimeout() method โฐ

View it live

Curious about who the killer is? ๐Ÿ‘€ Try it out, live at Netlify: https://mystifying-meitner-3dd588.netlify.app/

project-cluedo's People

Contributors

vanessasue27 avatar jenniedalgren avatar

Stargazers

Roman avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.