I'm working on a fantasy themed Flappy Bird clone, and I'm looking for advice on something. I have a skeleton enemy that throws bones at the player (though my question applies to any enemy that attacks with projectiles). The Skeleton class has a list of Bone objects, and it calls each Bone's update and draw methods within it's own respective methods. The problem is, when the skeleton dies after throwing a bone, the bone "dies" as well.
I ran into a similar problem with the bone's collider, as the main game loop was checking each object belonging to it's class - the hero and all monsters. Because the bones belong to the skeletons, I had to expose a list of the bones colliders through a getter so the main update loop could iterate over those as well. Should I try something similar for the bone objects themselves? If I grab the list of bones from each skeleton in the main loop, I can update and draw them independently of the skeleton - and I'll also have direct access to their colliders.
Typing out this question actually helped me come up with some ideas (don't you love when that happens?), but I'll pose my main question anyway. Should an enemy's projectiles (or any other game object that logically belongs to the enemy, or any other object for that matter) be members of the enemy class itself, or should they exist at the game loop level, next to the enemies? The latter seems like really poor design, and I'm not sure how I would handle the skeleton telling the main class that it should create a new bone. I prefer the former approach, but any input would be appreciated.
It shouldn't matter for this question, but I'm using libGDX.