METAVERSE
Metaverse Front-End Playground is an open-source project created to empower developers (all beginners to proficient coders) to explore, innovate, and collaborate in the metaverse space.
Created on 2nd August 2024
•
METAVERSE
Metaverse Front-End Playground is an open-source project created to empower developers (all beginners to proficient coders) to explore, innovate, and collaborate in the metaverse space.
The problem METAVERSE solves
The Simon game is a memory skill game where players repeat a sequence of lights and sounds. It's important for improving memory and cognitive skills.
Playing Simon helps enhance short-term memory and concentration, making it a fun and educational tool for all ages.
It is one of the most popular and recognized game all over the world.
Problem (Bug):
The game didn't reset correctly on restarts, causing malfunction. Also, the high score wasn't updating accurately, leading to incorrect displays.
Challenges I ran into
Game Restart Issue:
Problem: The game didn't reset the level and pattern properly on restart, causing issues on subsequent plays.
Solution: Added a startGame function to initialize the game by resetting the level, game pattern, and user pattern. This function is called whenever the game is started or restarted.
High Score Display:
Problem: The highest score wasn't updating correctly, leading to incorrect high score displays.
Solution: Moved the high score update code inside the checkAnswer function to ensure it's updated correctly after each successful level.
Event Listener Overlap:
Problem: Multiple event listeners were attached on multiple restarts, causing unintended behavior.
Solution: Ensured the game initialization code runs only once by checking if the game has already started, preventing multiple event listeners from being attached.
User Pattern Reset:
Problem: The user pattern wasn't resetting at the start of each new sequence, leading to incorrect pattern matching.
Solution: Reset the userClickedPattern array at the beginning of the nextSequence function to ensure a fresh pattern check for each level.
Popup and Overlay Visibility:
Problem: The popup and overlay elements weren't handled correctly when the game started, confusing the user.
Solution: Added code to show and hide the popup and overlay elements appropriately when the game starts and restarts, improving user experience.
Technologies used
