Sure! Here's an example of a simple 2D fighting game implemented in a single HTML file using JavaScript:
In this example, you have a canvas representing the game screen with a player and an enemy. The player can be moved by tapping the left or right side of the screen on a smartphone. The enemy moves randomly. When the player collides with the enemy, both lose some health. The game ends when either the player or the enemy health reaches zero, and the health bar reflects the remaining health of the player.
Note: This is a minimal example to showcase the main functionalities. A real game would require additional features, such as different attacks, animations, and more complex enemy AI.