Sure! Here's an example of a simple game that meets your requirements:
In this game, you'll see a 9x9 grid with each square represented by a div element. The whale is represented by a car emoji (
🚗), and the monster is represented by an alien emoji (
👾). You can move the whale by clicking on the square you want to move to. The objective is to stay away from the monster.
If the whale moves to a square adjacent to the monster, the game is over and an alert will be shown. To restart the game, simply close the alert and the game will automatically reset.
Note: This is a basic implementation of the game. You can add more features or improve the visuals as per your requirement.