Sure, here's an example of a simple game where the player aims and shoots at red targets using a gun controlled by the mouse cursor. The game is implemented as a single HTML file with JavaScript enclosed in script tags:
To play the game, simply copy the above code into a new HTML file and open it in a web browser (preferably on a smartphone) to start playing. The player can aim the gun by moving the mouse cursor (or their finger) on the canvas and shoot by clicking (or tapping) on the canvas. The goal is to hit the red targets with the bullets.