Sure! Here's an example of a simple game where you can shoot bad guys using JavaScript, presented as a single HTML file:
To play the game, save the above code into an HTML file, open it in a web browser (preferably on a smartphone for touch control simulations), and you should be able to control the player using the left and right arrow keys or by touch gestures. Your goal is to avoid colliding with the falling bad guys and survive as long as possible while gaining score.
Please note that this is a basic implementation to give you the gist of the game. You can enhance and style it further to your liking.