I'm glad to see that you're interested in creating a game using JavaScript! Below is an example of a simple snake game implemented in a single HTML file with JavaScript enclosed in script tags:
This code creates a simple snake game where the player controls the direction of the snake to eat food and grow larger. The game ends if the snake hits the walls or collides with itself. Feel free to customize and enhance the game further to make it more engaging!