Sure! Here's an example of a simple tower defense game implemented as a single HTML file with JavaScript:
This code creates a simple tower defense game where enemies are moving from left to right on the game board and the player can shoot them by clicking on the game board using their mouse. The tower follows the player's mouse movement and shoots bullet objects towards the enemies. When a bullet collides with an enemy, both the enemy and the bullet are removed from the game board.