It is fine. The art looks nice also. But the gun fires too rapidly when you hold down Q. That is supposed to be a pistol, right? If not that is probably a bug. From this behavior I can conclude that you are using the Keydown event or using isKeyDown("q")
. You should instead use the Keypressed event or isKeyJustPressed("q")
.
Also in the first version, you can shoot at the yellow thing but it won’t get “damaged”, because it seems like it only gets “damaged” when the cursor is touching the yellow thing. Realistically it should get “damaged” if you are aiming at the thing, whether or not the cursor is actually touching the thing. Even though this is probably above your level I will tell you how you can achieve that. You can do this by treating the bullet as a ray, and checking if the ray intersects with the thing’s rectangular axis-aligned (not rotated) hitbox. I’m pretty sure there’s a formula to do this that you can search up online. I will try to find that. this? https://stackoverflow.com/questions/10906381/how-to-find-out-if-a-ray-intersects-a-rectangle