Here is a simple example of a game implemented as a single HTML file containing JavaScript code enclosed in script tags:
Street Dogs Game
This game is a simple simulation where the player can control a dog icon on the screen by touching and dragging on a smartphone. The player icon is represented by a brown square, and it can be moved based on the touch input. The game loop continuously updates the screen by clearing the canvas and redrawing the player icon.
Please copy and paste this code into a new HTML file and open it in a web browser to play the game. Enjoy!