Here is an example code for a simple game in which circles and squares shoot out projectiles:
You can copy and paste this code into an HTML file and open it in a browser to play the game. Use the left and right arrow keys to move the player and the spacebar to shoot projectiles at the enemies. The game ends when an enemy reaches the bottom of the canvas. Enjoy playing!