Sure! Here's an example of a simple Pac-Man game written in a single HTML file using JavaScript:
In this implementation, the game is displayed in a simple grid-like container. Pac-Man can be moved using the arrow keys, and the goal is to eat the food objects that spawn randomly on the grid. As Pac-Man eats the food, the score increases. The gameLoop function continuously updates the Pac-Man's position, checks for food collisions, and renders the changes on the screen.