PROJECT 5
This week's been all about Javascript, learning about arrays and objects. We're going to hook that up with some html and css in this project!
So - This week’s project is to create a piece of the famous board game Cluedo.
The user (who is the game leader and the one that will know all about the murder) should be able to click on three decks of cards, to randomly get a character, 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.
The suspects and the weapons have several details about them whilst the rooms only has a name.
The suspects Mr Green - Jacob Green Professor Plum - Victor Plum Miss Scarlet - Cassandra Scarlet Mrs Peacock - Eleanor Peacock Colonel Mustard - Jack Mustard Mrs White - Mrs White
The Weapons Rope Knife Candlestick Dumbbell Poison Axe Bat Trophy Pistol
The Rooms Dinning Room Conservatory Kitchen Study Library Billiard Room Lounge Ballroom Hall Spa Living Room Observatory Theater Guest House Patio
git add .
git commit -m "step 1 done"
git push origin master
Try to console log the arrays to see that everyhting is there.
When clicking on the cards, you should invoke the right functions to pick a murderer, a room and a weapon. That should be stored in the mysterty object and we should visually see the chosen cards in the browser.
When clicking the button Reveal Mystery, we should see a message saying something like: The murder was committed by Jacob Green, in the living room with a rope.
- Create and manipulate objects
- Create arrays
- More about manipulating the DOM using Javascript
- Fork this repo
- Clone this repo into your projects folder on your computer
- Open up VS Code and start coding!
- Code follows Technigo’s code guidelines.
- Site should have three clickable cards and a clickable button.
- You should be able to randomly pick suspects, weapons and rooms.
- You should be able to reveal the mystery.
- If selected; demo your solution for your team.
-
When you’re finished with the project, push your code to GitHub with these commands:
git add . git commit -m "your commit message" git push origin master
-
Navigate to your repo and create a Pull Request into the Technigo repo
-
Add a link to your deployed site in the comments of the PR.
-
Wait for the code review from your teachers
Ask for help and share your knowledge about this project with the 'cluedo-site-project' tag on Stack Overflow. Talk to your team on Slack and help each other out. Do some research about your problem, you are surely not the first one with this problem, Google is your friend 🙂. And you can of course also reach out to your teachers.
Make sure you've commited and pushed a version of your project before starting with the stretch goals.
Design
- Make the site responsive.
- Spend some time to make it look nice.
- Add images of your suspects and maybe the weapons.
Deep-dive
- Add the functionality to say something like: "No mystery is yet to be revealed" if you click the reveal button but haven't selected suspect, weapon and room yet.
- Add a fourth deck of card, maybe about when the murder was commited.
Helpful readings