Sure! Here's an example of a simple treasure hunting game implemented as a single HTML file using JavaScript:
In this game, the player's goal is to move the red square (representing a pirate) to the yellow square (representing the treasure) and collect points. The player can use arrow keys to move around the canvas. Each time the player collects the treasure, the treasure is respawned at a random location, and the difficulty is increased by moving the treasure further away.
Please note that this is a basic demonstration and the graphics are very simple. You can enhance the game by incorporating additional features, sound effects, and better graphics according to your specific requirements.