Sure, here's an example of a simple sniper game implemented as a single HTML file using JavaScript:
In this game, the player needs to click on a red target that randomly appears within the canvas. Every time the player successfully clicks on the target, they earn a point and a new target is generated at a different position. The score is displayed based on the number of successful hits.
You can copy the above code into a new HTML file and open it in a web browser to play the game on a smartphone or any device with a web browser.