(Developer: Jamie Letts)
This is the website for DC Games, it is designed to be responsive and accessible on all devices. It consists of 2 games, a hangman game, and a multiple-choice quiz. Both games are themed around the animated comic of Batman.
- Project Goals
- User Experience
- Design
- Technologies Used
- Features
- Testing
- Bugs
- Deployment
- Credits
- Acknowledgements
Primary goal is to provide a user-friendly, fun, and good-looking interactive website which offers the game Hangman and a multiple-choice quiz.
- Play both games that are fun and engaging.
- Easily find the rules of each game.
- Easily get in touch via a contact form.
- Create a website with entertaining games.
- Create visually appealing designs throughout.
- Easy navigation throughout.
- Provide a fully responsive and accessible design.
- A clean design that stands out and catches the users attention.
- A website that responds correctly on all devices where design and effectiveness is not hindered on any device.
- An easy to navigate website with clear pathways to specific pages such as rules, each game, home, and contact.
- Ages 8 to 12.
- It is specific to those who have an in interest in DC comics, particularly Batman.
- A simple and intuitive navigation system.
- Quickly and easily find relevant information.
- Links and functions that work as expected.
- Good presentation and a visually appealing design regardless of device used.
- Easy to follow the games and rules.
- Simple content that the user can follow and understand.
- An easy way to contact the developer for feedback.
- Accessibility.
- I want to easily understand the rules of each game.
- I want to easily navigate to my chosen game.
- I want the games to be fun, enjoyable, and easy to understand.
- I want to know how I did at the end of each game.
- I want a means to contact the developer and have confirmation the message has been sent.
- I want to play the game both by clicking the mouse and using the keyboard.
- I want to know which letters I’ve used already.
- I want to know how many guesses I have left.
- I want the gallows image to add on sections of the hangman each time a letter is guessed incorrectly.
- I see to my score of wins vs losses.
- I want to know how much time is left to answer the question.
- I want to know which answer is correct if answered incorrectly.
- I want to know the answer if I run out of time.
- I want to see my score at the end.
- I want to easily play again or quit once I have finished.
- I want the user to get a genuine feel this is a DC Batman themed site.
- I want the user to easily understand and play the games.
- I want both games to be fully responsive.
- In hangman, the phrases / words are limited, so to increase the difficulty and longevity of the game, the word will not be revealed if guessed incorrectly.
- I want the user to be able to contact me for any reason they feel fit.
- I want the user to come to a 404 page and be automatically re-directed to the home page should they enter an invalid url.
- I want the user to have a link to my work via my Github repositories.
The design has been influenced by the comics like keeping the buttons square and grey to present comments in comic books. Each game has been designed around the colours and personality of the characters in the comics.
DC uses a specific blue which is used sparingly throughout the website.
Batman colours are predominantly black and yellow.
Both The Riddler and Joker are themed by purples and greens.
Google fonts were used to import the ‘Anton’ font used with a sans-serif fallback throughout the website:
I chose this font as it stood out to me as a strong and bold font that represented Batman well. It is also easy to read which is good for the target audience.
The page is structured in a user friendly and visually appealing way. Upon arriving the user will see a simple display with clear instructions to what the site offers and where to find the rules of each game.
The website consists of four separate pages with rules and result modals:
- A homepage with a with clear navigation to the games and rules.
- The Batman Hangman game page
- The Riddler’s Quiz game page.
- A contact page with a form that will directly send messages to the developer.
- Modals with the rules of each game.
- There is also a 404 page that directs the user back to the home.
- Visual Studio Code
- Bootstrap v5.3
- Git
- Github
- GitPod
- Tiny PNG
- Balsamiq
- Google Fonts
- Adobe Suite (Illustrator, Photoshop & InDesign)
- Font Awesome
- Favicon
- Giphy
- W3C validator
- Jigsaw CSS validator
- WAVE Web Accessibility Evaluation Tool
- jshint
The page consists of four pages and eleven features.
- Upon arriving to the site a welcome modal pops up.
- It details where to find the games, the rules and contact information.
- The rules are modals accessed by clicking the '?' symbols.
- The logo is DC's official logo.
- User stories covered: 1, 2, 3, 5, 16 & 17.
- Both the Batman and Riddler characters are that of The Batman animated series, which the games are based on.
- Navigation buttons are featured on all pages; they all have squared edges to represent sections and comments of a comic.
- Link to each game and the home page.
- It allows users to easily navigate through the website.
- The buttons are animated depending on which page they are on, matching the themes.
- User stories covered: 2, 5, & 16.
- Clicking the question mark under the selected character will bring up the rules for that game.
- User stories covered: 1.
- Featured on all pages.
- Details who the developer is, a link to Github and contact page.
- User stories covered: 5, 20 & 22.
- Consists of empty gallows, empty score, and number of wrong guesses left.
- Letter keys for entry guesses, allows user to use either mouse or keyboard for entries.
- If the letter is guessed correctly the letter is revealed in replace of the '_'
- If the phrase is guessed correctly a modal is presented confirming the win with the total number of wins and losses.
- If the letter is guessed incorrectly the hangman image increases as does the number of wrong guesses.
- If the phrase is guessed incorrectly a modal is presented confirming the loss with the total number of wins and losses.
- On pressing a letter, it is highlighted yellow and then greyed out once used, it cannot be used again.
- Reset button resets the game but keeps track the total wins and losses until page is refreshed.
- The theme of the game is Batman and The Joker, and all colours, wording and design are based on the animated series.
- A comical element has been added to the results modal which is light-hearted fun. For each win and loss both characters have 5 different phrases which are randomly selected each time and play on the characters personality.
- User stories covered: 6, 7, 8, 9 10, 16, 18 & 19.
- Displays current score, wins v losses.
- Close Button that resets the game.
- User stories covered: 4, 10 & 19.
- Displays current score, wins v losses.
- Close Button that resets the game.
- User stories covered: 4, 10 & 19.
- Start Button.
- Navigation buttons.
- The game is themed in the colours of The Riddler, green and purple.
- Game modal is presented once start button is pressed.
- Game consists of a timer, time bar and multiple choice questions the user can click or tab to and press enter to select.
- When a question is answered correctly it is highlighted in green with a tick icon.
- When a question is answered incorrectly it is highlighted in black with a cross icon and the correct answer is displayed.
- At the end of the game the score is tallied and revealed in a modal.
- A comical element has been added to the results modal which is light-hearted fun. Dependning the score The riddler's phrase will change.
- User stories covered: 3, 11, 12 & 13.
- Displays score.
- Replay button that resets the game.
- Quit button that refreshes the page.
- User Stories covered: 4, 14 & 15.
- Allows user to directly contact the developer
- Alert box pops up when message has been sent successfully.
- User stories covered: 5 & 20.
- Explains to the user they have landed on an unrecognised page.
- It automatically returns the user back to the home page after 10 seconds, detailed by a count down.
- There is also a home button should the user wish to use it.
- User Stories covered: 21.
The W3C Markup Validation Service was used to validate the HTML of the website. All pages pass with no errors.
index.html results
hangman.html results
quiz.html results
contact.html results
404.html results
The W3C Jigsaw CSS Validation Service was used to validate the CSS of the website. When pasting in my index url 16 Parse Errors are flagged, all linked to Bootstrap as well as 286 warnings.
style.css results
When validating just my own custom CSS file it passes with no errors and flagged three warnings using pointer-events twice used and 1 warning for the google fonts import used.
JSHint JS Validation Service was used to validate the Javascript files. No significant issues were found. One undefined Variable found in quiz.js for the questions variable used as it's linked to a separate file.
OnClick buttons were flagged as unused, but /* exported */ feature was used to remove the flags as they are called in the html files.
The WAVE WebAIM web accessibility evaluation tool was used to ensure the website met high accessibility standards. All pages pass with 0 errors apart from quiz.html that has 3. They are all contrasting errors to which I disagree with, the white on purple to me is perfectly visible and matches the colour scheme so have chosen to leave it as it is.
index.html results
hangman.html results
quiz.html results
contact.html results
404.html results
Google Lighthouse in Google Chrome Developer Tools was used to test the performance of the website. All results scoring 95 or above.
The website was tested on the following devices:
- MacBook Pro
- iPad Tablet
- Google Pixel 5
- iPhone 12
In addition, the website was tested using Google Chrome Developer Tools device toggle option for all available device options.
The website was tested on the following browsers:
- Google Chrome
- Apple Safari
- Mozilla Firefox
- I want to easily understand the rules of each game.
Feature | Action | Expected Result | Actual Result |
---|---|---|---|
'?' Icon | Click either '?' icon | Modal pops up explaining rules of choses game | Works as expected |
- I want to easily navigate to my chosen game.
Feature | Action | Expected Result | Actual Result |
---|---|---|---|
Button | Click button | Takes user to chosen game | Works as expected |
- I want the games to be fun, enjoyable and easy to understand.
Feature | Action | Expected Result | Actual Result |
---|---|---|---|
'?' Icon | Click either '?' icon | Modal pops up explaining rules of choses game | Works as expected |
Button | Click button | Takes user to chosen game | Works as expected |
In-game Play | Games are easy to follow, pleasing on the eye and fun | In-game play | Work as expected |
Score Modal | Finish each game | Humorous modal pops up displaying score. | Works as expected |
- I want to know how I did at the end of each game, and easily play again.
Feature | Action | Expected Result | Actual Result |
---|---|---|---|
Score Modal | Finish each game | Humorous modal pops up displaying score. | Works as expected |
Play Again | Finish game | Close modal, game resets, score is tallied. | Works as expected |
- I want a means to contact the developer and have confirmation the message has been sent.
Feature | Action | Expected Result | Actual Result |
---|---|---|---|
Email Icon | Click Icon | Takes user to contact page | Works as expected |
- I want to play the game both by clicking the mouse and using the keyboard.
Feature | Action | Expected Result | Actual Result |
---|---|---|---|
Keyboard Test | Use mouse & keyboard | Key should highlight when pressed / clicked down then disable after | Works as expected |
- I want to know which letters I’ve used already.
Feature | Action | Expected Result | Actual Result |
---|---|---|---|
Keyboard Test | Use mouse & keyboard | Key should highlight when pressed / clicked down then disable after | Works as expected |
- I want to know how many guesses I have left.
Feature | Action | Expected Result | Actual Result |
---|---|---|---|
Guesses Left | Select incorrect key | Guess left display increases by one | Works as expected |
- I want the gallows image to add on sections of the hangman each time a letter is guessed incorrectly.
Feature | Action | Expected Result | Actual Result |
---|---|---|---|
Gallows Image | Select incorrect key | Gallows image adds body part | Works as expected |
- I want to see to my score of wins vs losses.
Feature | Action | Expected Result | Actual Result |
---|---|---|---|
Main screen | Win or lose game | Score is updated | Works as expected |
Result Modal | Win or lose game | Score is displayed | Works as expected |
- I want to know how much time is left to answer the question.
Feature | Action | Expected Result | Actual Result |
---|---|---|---|
Countdown Timer & Bar | Start game | Countdown timer and time bar are displayed | Works as expected |
- I want to know which answer is correct if answered incorrectly.
Feature | Action | Expected Result | Actual Result |
---|---|---|---|
Highlight correct answer | Select incorrect option | Correct answer is displayed | Works as expected |
- I want to know the answer if I run out of time.
Feature | Action | Expected Result | Actual Result |
---|---|---|---|
Highlight correct answer | Let time run out | Correct answer is displayed | Works as expected |
- I want to see my score at the end.
Feature | Action | Expected Result | Actual Result |
---|---|---|---|
Quiz Finish Modal | Finish Quiz | Score is tallied | Works as expected |
- I want to easily play again or quit once I have finished.
Feature | Action | Expected Result | Actual Result |
---|---|---|---|
Quiz Finish Modal | Finish Quiz | Restart and Quit buttons displayed | Works as expected |
- I want the user to get a genuine feel this is a DC Batman themed site.
Feature | Action | Expected Result | Actual Result |
---|---|---|---|
Batman Theme | Display pages | All colours and imagery are that of DC's Batman animated series | Works as expected |
- I want the user to easily understand how to play the games.
Feature | Action | Expected Result | Actual Result |
---|---|---|---|
'?' Icon | Click either '?' icon | Modal pops up explaining rules of choses game | Works as expected |
- I want both games to be fully responsive.
Feature | Action | Expected Result | Actual Result |
---|---|---|---|
Responsiveness | Test in google developer | Adjusts to each device correctly | Works as expected |
- In hangman, the phrases / words are limited, so to increase the difficulty and longevity of the game, the phrase will not be revealed if guessed incorrectly.
Feature | Action | Expected Result | Actual Result |
---|---|---|---|
Score Modal | Finish each game | Score displayed but he hidden phrase is not | Works as expected |
- I want the user to be able to contact me for any reason they feel fit.
Feature | Action | Expected Result | Actual Result |
---|---|---|---|
Email Icon | Click Icon | Takes user to contact page | Works as expected |
- I want the user to come to a 404 page and be automatically re-directed to the home page should they enter an invalid url.
Feature | Action | Expected Result | Actual Result |
---|---|---|---|
404 Page | Enter invalid url | 404 page is displayed, countdown timer returns user to home page | Works as expected |
- I want the user to have a link to my work via my Github repositories.
Feature | Action | Expected Result | Actual Result |
---|---|---|---|
Github Icon | Click Icon | Takes user to repository page for the game | Works as expected |
-
Each time a key on the board selected an incorrect word two mistakes were added instead of one. The checkLetter function was called in both the keydown and keyup event listeners. By removing it in one fixed the issue.
-
During testing when using some iPhones all the button styling was off. This is down to using default button stlying. To fix I added my own styling to match that of the chrome default.
.button-keys:disabled {
opacity: 0.5;
}
- I really wanted my 'Reset' button to change yellow on 'keydown' like it does with a mouse click, my first attempt isolated the enter to key to only work on the reset button. This had a negative effect on the other buttons and affected accessibility as enter no longer worked on any other buttons. I then ran into issues with the event listeners being constantly active once called on which caused the 'Reset' button to constantly flash yellow if enter was pressed. This was eventually fixed by adding removeEventListener functions if enter is pressed when the reset button was not targeted.
function removeEventListeners() {
document.removeEventListener('keydown', keyDown);
document.removeEventListener('keyup', keyUp);
}
if(!keyDownButton || !keyUpButton) {
removeEventListeners();
}
-
When the user selected an answer the timer continued to tick down and if it then reached 0 the function was called to display the right wrong or answer, which were already on display as an answer was already clicked. This caused the game to display icons twice and looked messy. It was fixed by adding the clearInterval function to the answerSelected function once one had been clicked, resulting in the timer freezing until the next question button is clicked.
-
When the user clicked restart the question number was not reset, so the game displayed 10 out 10 questions instead of 1 out 10. To fix this I reset the question number to 1 in the restart function.
-
Issue with the display not covering the full screen on certain screen dimensions, particularly long / tall iPads in google developer tools. Fixed by adding a specific vh height to the title in media queries.
@media screen and (max-width:920px) {
#hangman-title {
height: 40vh;
}
}
The website was deployed using GitHub Pages by following these steps:
- In the GitHub repository navigate to the Settings tab.
- On the left-hand menu select Pages.
- For the source select Branch: main.
- After the webpage refreshes automatically you will see a ribbon on the top saying: "Your site is published at https://jamie2210.github.io/CI_MS2_DCG/index.html.
You can for fork the repository by following these steps:
- Go to the GitHub repository.
- Click on Fork button in upper right-hand corner.
You can clone the repository by following these steps:
- Go to the GitHub repository .
- Locate the Code button above the list of files and click it.
- Select if you prefer to clone using HTTPS, SSH, or Github CLI and click the copy button to copy the URL to your clipboard.
- Open Git Bash.
- Change the current working directory to the one where you want the cloned directory.
- Type git clone and paste the URL from the clipboard ($ git clone https://github.com/YOUR-USERNAME/YOUR-REPOSITORY).
- Press Enter to create your local clone.
Images and logos not referenced below are owned or created by the developer.
All images used have a free licence for personal use.
Images taken from Clipartmax;
Images taken from pngimg;
Images taken from Free Vector;
Images taken from Vecteezy;
Images taken from freepik;
-
The Javascript for Sweet Alert email submit response was taken from the Sweet Alert guide.
-
Guidance was taken from this tutorial Useful Prgrammer to add tab answer function to quiz answer selection and question icons.
-
Stack Overflow was used throughout for hints, tips and tricks.
-
w3schools was used for a better undertstanding of set intervals and timers.
-
MDN helped me understand removeEventListeners further.
-
Inspiration and guidance for hangman was taken from Simon Suh hangman Game tutorial on youtube.
-
Inspiration and guidance for a quiz with a timer was taken from Ali Aslan quiz tutorial on youtube.
I would like to take the opportunity to thank;
- My mentor, Mo Shami, for his excellent feedback, advice support and guidance throughout.
- Tutor support from Code Institute for their swift response.
- The slack community of coders for immediate and helpful response.
- WAES College and my Tutor Michael for their support and help throughout.