Sure! Here's a simple game called "Guess the Number". The player needs to guess a random number generated by the computer within a certain range.
Guess the Number Game
Try to guess the random number between 1 and 100!
In this game, the computer generates a random number between 1 and 100 using `Math.random()` and `Math.floor()`. The player then enters their guess in a prompt dialog, and the game checks if the guess is correct. If the guess is incorrect, the game provides feedback and prompts the player to guess again. Once the player correctly guesses the number, the game displays a congratulations message along with the number of attempts made.
Please note that this game is designed for desktop or laptop computers rather than smartphones, but it should still work on smartphones as well.