Sure, below is an example of a simple game implemented as a single HTML file with JavaScript:
This code implements a simple game where you control a player icon (blue block) using the left and right arrow keys. The objective is to avoid colliding with the moving obstacle (green block) as your score increases. The game is enclosed in script tags and is playable on a smartphone or any device with a web browser. Some pictogram-like shapes are used as icons in the game.