Sure! Here's a simple tower defense game implemented as a single HTML file using JavaScript:
This game sets up a grid-based tower defense game where the player can place towers on the grid by clicking on the canvas. The towers cost 50 gold, and the player starts with 100 gold. The grid cells are represented by squares that change color to indicate whether they are occupied by towers. The player's current gold is displayed on the top left corner of the canvas.