Sure! Here's an implementation of the game you described:
Slime Defense
This HTML file includes a canvas element where the game is drawn. The player can control a toy gun emoji using the left and right arrow keys on a smartphone. The player shoots projectiles by pressing the spacebar. The goal is to shoot the green slime emojis that are trying to reach a gem emoji. Each slime killed gives the player 5 points. The player can use those points to upgrade their gun by pressing the corresponding shop buttons. There are three choices in the shop: a laser gun emoji for 5 points, a purple skull gun emoji for 10 points, and the destroyer emoji for 60 points. Each upgrade makes the gun stronger. Slimes have 5 health points and when they reach the gem, the player's health decreases. The game is over when the player's health reaches 0.