Sure, here is a simple game where you control a character and try to reach the end while avoiding obstacles. The game is implemented as a single HTML file, enclosed in script tags, and written in JavaScript.
To play the game, save the code above as a ".html" file, then open it in a web browser. Use the arrow keys on your keyboard to control the player and try to reach the green end point while avoiding the blue obstacle. If you collide with the obstacle, you will be reset to the starting position. When you successfully reach the end point, an alert will be displayed congratulating you.