Random mystery picker inspired in the classic 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 of this project is to practice objects and arrays and also to manipulate the DOM with JavaScript.
I've started by building the card decks by styling them and then create all the object lists and the arrays, I wanted all to show details and images about the suspect, weapon and room respectively so I changed my object lists to reflect that when the functions are called. When the user clicks on each deck a card will be displayed by calling a function which will randomly select from the arrays a "killer", "weapon" and "room" a card will be displayed. I've also added a function to random generate a "killer's favourite weapon.
Then there's a "Reveal mystery" button that once the cards mentioned above have been clicked will manipulate the DOM by JavaScript and reveal the mystery.
- HTML5
- CSS3
- JavaScript