Sure! Here's an example of a simplified version of the game you described in a single HTML file:
This is a basic implementation of the game. The player (red square) can move up and down using the arrow keys on a smartphone. The obstacle (black rectangle) moves from right to left, and the player needs to avoid colliding with it. Colliding with the obstacle will trigger a game over alert.
Note that this is a simplified version and does not include music or advanced levels. You can modify and expand upon this code to introduce more features and gameplay elements.