Sure! Here's a simple example of a 2D fighting game implemented as a single HTML file using JavaScript. Please note that this is a basic implementation to give you an idea, and you can expand on it to add more features and complexity.
This basic game allows the player to control a red square using the Arrow keys. The square can move left and right, and jump when the Up arrow is pressed. It also simulates gravity and collision with the ground.
Feel free to enhance this example by adding more features such as enemy characters, special attacks, health bars, animations, and sound effects to create a more comprehensive 2D fighting game experience.