Sure! Here's an example of a simple space game where you navigate a spacecraft and try to avoid colliding with randomly generated planets. It's implemented as a single HTML file enclosed in script tags:
To play the game, you can copy the code into an empty HTML file and open it in a web browser. Use the arrow keys to navigate your spacecraft and try to avoid colliding with the randomly generated planets. Your score will increase as you avoid collisions. If you collide with a planet, the game will end and display your final score.