Sure! Here's an implementation of the fighting game you described using HTML and JavaScript:
To play the game, open the HTML file in a web browser (preferably on a smartphone) and use the arrow keys to move the blue square left and right. Press the up arrow key to punch and the down arrow key to crouch. Holding the down arrow key and pressing the up arrow key performs an uppercut. The red square opponent will move towards the player and occasionally punch with the same hitbox as its square. The hitboxes for punch stay active for 0.1 seconds and deal 5 damage, while the uppercut hitbox stays active for 0.2 seconds and deals 15 damage.