Sure! Here's an example of a simple tank game implemented as a single HTML file using JavaScript. It includes movement controls, shooting bullets, and infinite target spawning. You can copy the code below and save it as an HTML file to play the game. Please note that for simplicity, this game is designed to be played on a desktop browser using arrow keys for movement instead of smartphone operation.
To play the game, save the code as an HTML file, open it in a browser, and use the arrow keys to move the tank. Press the spacebar to shoot bullets. The target will appear at a random location on the canvas, and you need to hit it with your bullets to make it disappear and respawn at a new location. The game will continue running indefinitely, allowing you to enjoy playing it as much as you want.