I've been making a space themed, semi-roguelike as a passion project for about 1 year (6 months actual work). Before I explain the bug, i need to explain some strange choices I made in the game for some reason:
- Ships are split into:
- The ship
- The turrets
- The barrels on the turrets
- The bullets shot from the barrels
- These are part of a family called "FullShip"
- I used block code in this game instead of JS
- There is a separate ID system from the UID, where every ship has a unique ID. All of the sprites in FullShip use this ID system. This is used for enemy > player AI, checking if a missile is out of its parent ship's range, etc.
- I only used around 3 basic behaviours in this game, which was somewhat stupid, but that shouldn't be too much of an issue in particular
Anyway, the main bug is that when a ship is destroyed, after a split second there is a small chance that every single bullet on the map gets destroyed. Due to how some parts of the game works, not only is this frustrating to look at, but can ruin certain moments. The REALLY weird bit is that when I disabled all the code that destroys a bullet (including code with families), the bug still happens. I created a separate build in which I found that the bullets were certainly being destroyed.
So, what's the deal here, Have I not given enough info or is this bug just too vague?