A brief firearms test

So I’m stuck waiting for some other stuff to happen and I was bored. As I didn’t have time to work on anything big and detailed I instead decided to write up a little bit of code I’ve been meaning to test out.

It is a working firearms test which tracks your current loaded bullets and any spare magazines you have. It might be useful :slight_smile:

You can test out the tech demo here


Let me know how you find it?


It worked well! Thanks for making this.

Is 7 points a good score? :sweat_smile:

1 Like

The best possible score is 15. For the test it’s a random 50/50 chance each shot.

1 Like

It worked without a hitch. I got 5 points. Guess I’m not very lucky, lol.


Everything works really well, except i can put the gun away once i have no magazines left, but still have 5 bullets loaded since i just reloaded the last magazine. If i understood the code that’s because once you reload the gun it automatically takes away five bullets from the variable “bullets” and the condition to select #Put the gun away is for you to have 0 in the “bullets” variable, not the “loaded” one. but that might be me talking gibberish lol (or that part is not even that relevant)

And i got 9 points :)! (let’s just ignore the time i replayed it and got only 2)

Okay my score is 4 point, i already know my luck is bad

No you are right it needs to check both. I’ll correct it after work.


So far, the system itself is good and I think everyone else has already stated in many other comments.

My only concern with this system is that this may become repetitive and chore-like for the player in a game because of how it kind of breaks the pace. This can be alleviated by simply giving an active and dynamic description depending on who you’re fighting instead of having the same template for every engagement.


Oh I totally agree. This was just a bare bones attempt to test the system itself i.e it tracks every shot and makes players have to reload and knows when the player is out of ammo.

If put into a game it would be a lot more detailed. :slight_smile:


Woah it works! First round I got 6 points. Decided to replay and got 8 points. Maybe I’ll retry again and again just to score that perfect 15… :laughing: