Giter Site home page Giter Site logo

lab-javascript-clue's Introduction

Ironhack Logo

JS | Clue - Mixin objects and arrays

Do you remember de classic detective game?

Clue was a very popular game in the 90's. The plot starts with Mr. Boddy being killed by one of his guests. He was the very rich owner of Tudor Close, who takes the stock character of a generic victim. After his dead, Clue players have to to discover who murdered him, with what implement, and where the crime scene took place in his mansion.

Hasbro, the toy maker company and owner of Cluedo, recently changed some of the characters bio. Use the bio to gather information from the characters.

![Clue Picture](https://i.imgur.com/AZWieq9.jpg =300)

Requirements

Submission Instructions

Upon completion, run the following commands

$ git add .
$ git commit -m "done"
$ git push origin master

Navigate to your repo and create a Pull Request -from your master branch to the original repository master branch.

In the Pull request name, add your name and last names separated by a dash "-"

Deliverables

Write your JavaScript in the provided file. Submitting this file will be enough.

Iteration 1 - Creating the cards

Clue has three different types of cards: suspects, rooms, and weapons. These three types of cards are always separated. Use data structures to model and create these cards.

In order to do this, you will need to know the game's characters (possible killers), available weapons and house rooms.

Game Characters

This Clue board game has a new roster of playable characters. All of them have first names, last names, occupations, age, description and images. Here you will find a list of some of their attributes. Search or create what you miss -give you the opportunity to play with your imagination 😆

  • Jacob Green: his color is green. He has a lot of connections and is always willing to help people out -- for a price.

  • Doctor Orchid: her color is white. She is the adopted daugther of Mr. Boddy, a biologist with a PhD in plant toxicology. She was privately educated in Switzerland until her expulsion after an incident involving daffodils resulted in a near-fatal poisoning (Wonder what happened with Mrs. White?).

  • Victor Plum: his color is purple. He is a billionaire video game designer who is embracing his new popularity.

  • Kasandra Scarlet: her color is red. She is an A-list movie star whose past haunts her.

  • Eleanor Peacock: her color is blue. She is from a wealthy family and uses her status and money to earn popularity.

  • Jack Mustard: his color is yellow. He is a former football player who tries to get by on his former glory.

Available Weapons

There are nine weapons. Keep in mind you can add new attributes as weight, color, or even count how much one of these weapons can hurt!

  • Rope
  • Knife
  • Candlestick
  • Dumbbell
  • Poison
  • Axe
  • Bat
  • Trophy
  • Pistol

House Rooms

The game board represents the blueprints of a mansion and features fifteen different rooms:

  • Dining room
  • Conservatory
  • Kitchen
  • Study
  • Library
  • Billiard room
  • Lounge
  • Ballroom
  • Hall
  • A spa
  • Living room
  • Observatory
  • Theater
  • Guest house
  • A patio

Create one data structure for each of the people, weapons and rooms described above. For example:

var mrGreen = {
  // Properties
};

var rope = {
  // Properties
}

// etc

Iteration 2 - Creating and revealing the mistery

At the beginning of the game, players shuffle each one of the card stacks to create a combination of suspect, weapon and room. This will be the mistery to solve.

  1. Create a method to randomly select one element from a card stack.
  2. Create another function that calls the method above once for each card stack.
  3. Place the “Case File Confidential” in a virtual envelope. 😉
  4. Create a method to reveal the mistery.

Extra Resources

lab-javascript-clue's People

Contributors

fontcuberta avatar michielab avatar

Watchers

 avatar  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.