Here's an example of a basic Pac-Man game implemented as a single HTML file using JavaScript. To make it suitable for smartphone operation, I will include touch event listeners for the game controls. Please note that the game logic and graphics in this example are simplified for brevity.
To play the game, you can copy the above code into an HTML file and open it in a web browser or on a smartphone. The game canvas will display a simple Pac-Man character controlled using touch controls. Pac-Man will move across the screen, wrapping around the boundaries, and change direction when you tap on the left or right half of the canvas.