Sure! Here's a simple example of a Sonic Run game implemented as a single HTML file with JavaScript:
This implementation creates a simple game where Sonic, represented by a blue square, runs from left to right on the canvas. The user can control Sonic's movement using the right and left arrow keys. The game loop continuously updates the game state, clears the canvas, and redraws Sonic on the updated position.
Note: This is a very basic example and can be expanded upon to include more gameplay elements, levels, and graphics.