Original Post
I am working on a small project in which the player controls a 2-Dimensional Tank - the problem is, I'm not entirely sure on how I should structure my projectiles. I plan on having three different projectiles - bullets, missiles and lasers (not relevant, but whatevs).
My game's WORLD object holds a TILEMAP, and the TILEMAP holds TILE objects: That's no problem. But my WORLD also holds PLAYER and ENEMY objects, which in turn should hold PROJECTILE objects - but if I assign the PLAYER or ENEMY objects PROJECTILE objects, won't the PROJECTILE objects be destroyed when the PLAYER or ENEMY object that they belong to gets destroyed?
My game's WORLD object holds a TILEMAP, and the TILEMAP holds TILE objects: That's no problem. But my WORLD also holds PLAYER and ENEMY objects, which in turn should hold PROJECTILE objects - but if I assign the PLAYER or ENEMY objects PROJECTILE objects, won't the PROJECTILE objects be destroyed when the PLAYER or ENEMY object that they belong to gets destroyed?