Number-Guessing-Game.v2

Number Guessing Game (.v2)

Description

This is a simple Number Guessing Game where users attempt to match their guess with a computer-generated number. Depending on the selected difficulty level, players may need to guess a number between 1 and 10, 1 and 25, or 1 and 50.

Different feedback will be given throughout the game, including the loss of lives, accumulation of points, and more.

Table of Contents

Origins and Evolution

This project initially began as an opportunity to practice jQuery. I decided to take the basic and straightforward JavaScript-Practice version of this game and elevate it, hence the “v2” in the project’s name.

My goal was to make the game more engaging and dynamic, and this journey allowed me to explore CSS animations for the first time.

The result is a game that, despite its simplicity, is both addictive and visually captivating.

How to use

1. Access the game

To access the game, open the index.html file in your browser engine or click here.

2. Choose difficulty level

When the game loads, it will show the game’s name along with three buttons, each representing a different difficulty level:




Game Page




3. Make your guess

Once you’ve chosen a difficulty level, the page will transform. It will feature an empty input field and a button labeled “Guess.” Additionally, you’ll find 10 hearts and points. The display depends on the device.




Start Game







Make a Guess







Win or loss alert




4. Get it right or get it wrong

If you correctly guess a number, you’ll earn a specific number of points based on the difficulty level you selected at the beginning:

Your points will accumulate throughout the game.




Points




However, if you make an incorrect guess, you’ll lose a heart (life). You start with a total of 10 lives.




Lose a heart




5. Game Over… Play again

If you run out of lives, the game will come to an end, and a ‘Game Over’ page will appear. Here, you can view the total number of points you earned during the round.

To start a new game, simply click the ‘Play Again’ button displayed on the ‘Game Over’ page. This will take you back to the beginning, where you can once again choose a difficulty level.




Game over page




Features

Tested Compatibility

Last updated: 04-09-2023

Browsers

The game was tested and works as expected in the following browsers and versions:




Browser Testing




Devices

The game is built to work in the following devices:

The game was ran in all three and worked as expected.

Customization

Please feel free to incorporate this code into your projects while adhering to the license it is distributed under. You’re welcome to customize it to your heart’s content—alter backgrounds, displays, colors, and more. The sky is the limit!

Contributions

Contributions are encouraged! If you’d like to contribute to this project:

  1. Fork the repository.
  2. Create a new branch for your feature: git checkout -b feature-name
  3. Commit your changes: git commit -m 'Add a new feature'
  4. Push to the branch: git push origin feature-name
  5. Submit a pull request.

License

This project is open-source and available under the MIT License.

MIT License

This project is licensed under the MIT License, which means you are free to use, modify, and distribute the code as long as you include the original license text.

Crediting us

Although this project is under the MIT License (as stated above), we would greatly appreciate it if you could:

Your support and collaboration mean a lot to us! For more clarification, visit the Crediting Us file provided in our project.

Disclaimer

Please be aware that while this project is provided under the MIT License, it is your responsibility to ensure that your usage complies with all applicable laws and regulations.

Feel free to use this project for your needs or contribute to its development.

For more details, refer to the MIT License file in this repository.

Attributions

This game uses free icons from FontAwesome that are generously provided under an MIT License.

For more details regarding attributions or copyright notices visit the Attributions File on this repository.