Sure, here is an example of a 2D action game implemented as a single HTML file using JavaScript:
You can run this HTML file in a web browser, and it will display the game where you control a blue cube using the arrow keys on your keyboard. Your goal is to eat all the black cubes while avoiding touching the red cubes. The blue cube will grow bigger and faster as you eat the black cubes. Once you eat all the 200 black cubes, you win the game. If you touch a red cube while smaller than it, you lose and see a "Game Over" message. On the other hand, if you touch a red cube while bigger, you eat it and increase your score. Good luck and have fun playing!