Sure! Here's an example of an endless runner game implemented as a single HTML file, enclosed in script tags using JavaScript:
This game creates a simple endless runner where the player controls a character represented by a red square. The goal is to avoid collision with green obstacles (also represented by squares) moving from right to left. The score increases with time survived without collision. Pressing the spacebar allows the player to jump and avoid obstacles. When a collision occurs, the game ends, and the score is shown in an alert dialog before restarting.
Please note that this is a basic implementation, and you can enhance it further by adding more game elements, animations, sound effects, etc.