Skip to content

BillOchieng/Simon-Says-Game-Project

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Basic Javascript (i.e. Simon-Says)

Beep Boop; Beep Boop; BRR BRR BRR

  • The Simon game project is an interactive web-based application that replicates the classic electronic game of memory skill. In this game, players are challenged to follow an increasingly complex sequence of lights and sounds. With each turn, the game adds one element to the sequence, and the player must replicate the sequence without mistakes. The game utilizes HTML, CSS, and JavaScript to create a user-friendly interface where players interact with colored buttons on the screen.

Here's a detailed description of the project

Project Overview

Title: Web-Based Simon Game Technologies Used: HTML, CSS, JavaScript

Game Mechanics:

  • The game consists of four colored buttons, each producing a specific tone when activated or clicked.
  • At the start of the game, the system randomly selects one of the buttons to light up and plays the corresponding sound.
  • Players must remember the sequence and replicate it by pressing the buttons in the correct order.
  • With each successful round, the sequence becomes longer by one, making the game progressively more challenging.
  • If a player fails to reproduce the sequence correctly, the game ends, and a "game over" sound is played. The player is then prompted to start a new game.

Features

  • Interactive UI: The game's interface is designed for simplicity and ease of use, with large, colorful buttons that visually and audibly respond to interactions.
  • Dynamic Difficulty: The game's difficulty increases with each turn, testing the player's memory and concentration skills.
  • Sound Effects: Each button has its own unique sound that plays when the button is activated, enhancing the sensory experience of the game.
  • Score Tracking: The game keeps track of the player's score based on the number of successfully completed sequences, displaying the current points on the screen.
  • Restart Capability: Players can start a new game at any time by pressing a "start" button, allowing for quick retries after a loss.

Development Considerations

  • Modular JavaScript: The game logic is encapsulated in functions that handle game turns, button activation, sound playback, and sequence validation to keep the code organized and maintainable.
  • Responsive Design: CSS is used to ensure the game's layout is responsive and adapts to different screen sizes, providing a consistent experience across devices.
  • Accessibility: Efforts are made to make the game accessible, including clear visual cues for active buttons and potentially adding keyboard controls for improved accessibility.

Project Goals

  • The primary goal of this project is to create a fun and engaging web-based version of the Simon game that challenges users' memory skills. Additionally, the project aims to demonstrate proficiency in front-end web development technologies and practices, including responsive design, interactive JavaScript, and user experience design.

  • This project serves both as an entertaining game for users and as a showcase of web development skills, including client-side scripting, HTML structure, and CSS styling.

How to run it; open html in a server

Potential game enhancements

Gameplay Enhancements

Difficulty Levels: Introduce difficulty settings (easy, medium, hard) that affect the speed of the sequence display and the delay between sequences. For instance, a shorter delay makes it harder to remember the sequence.

Visual & Audio Enhancements: Update the UI with more sophisticated animations for button presses and sequences. Consider adding different sound effects or music to enrich the user experience.

Score Multipliers: Implement score multipliers based on difficulty level or speed of correct responses to encourage competitive play and replayability.

Leaderboard: Create a leaderboard to track high scores either locally (using localStorage) or through a backend service, allowing players to compete for the top spots.

Game Modes: Add new game modes, such as a "reverse mode" where players must input the sequence in reverse order, or a "memory mode" where no visual cues are given after the initial display, relying solely on auditory cues.

Technical Improvements

HTML Structure: Replace the element with a semantic HTML element like

or
for the game area, as is not a standard HTML element. This change will improve the semantics and accessibility of your markup.

CSS Animations: Utilize CSS animations to make the game visually appealing. For example, adding a glow effect to buttons when activated or creating a more dynamic background can significantly enhance the visual feedback of the game.

JavaScript Refinements
  • Optimize Global Variables: Review and optimize the use of global variables. For instance, elements is derived from gameBtn but could be directly used where needed to reduce redundancy.
  • Modularize Code: Break down your JavaScript code into more modular functions for easier maintenance and readability. This approach helps in isolating functionality, making it easier to update or debug specific parts of the game.
  • Event Delegation: Instead of attaching an event listener to each game button, consider using event delegation to handle button clicks through a single listener on the parent element. This method is more efficient and scales better with more buttons.

Accessibility Enhancements: Ensure the game is accessible to all users, including those with disabilities. This includes adding keyboard navigation support, ensuring color choices have enough contrast for colorblind users, and using ARIA attributes to make the game more screen-reader friendly.

Progressive Web App (PWA): Convert the game into a PWA to allow users to 'install' it on their devices and play offline. This involves creating a service worker for caching and a manifest file to define the app's appearance and behavior when launched from a home screen.

Feedback System: Implement a feedback system within the game, such as visual or auditory cues, to indicate correct or incorrect sequences more clearly. Also, consider adding motivational messages or tips to keep players engaged and encourage continuous improvement.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published