I'm glad to see you are interested in creating a game! Below is a simple example of a game implemented in a single HTML file with JavaScript. Please copy and paste this code into an HTML file and open it in a web browser to play the game.
This game is a simple square that you can move around using the arrow keys on your keyboard. You can use this as a starting point to create more complex games or add more features to this one. Have fun coding!