Sure, here's an example of a simple JavaScript stickman battle 2D sword fight game implemented as a single HTML file:
In this game, you control the player stickman at the bottom of the game screen using the left and right arrow keys on your smartphone's keyboard. Pressing the spacebar will perform a sword attack. The objective is to hit the enemy stickman on the right side of the screen with your sword.
Note: This is a simple implementation for demonstration purposes. You can further enhance the game by adding animations, additional levels, and more advanced gameplay mechanics.