Jump to content

  • Log In with Google      Sign In   
  • Create Account


#ActualMisterFuzzy

Posted 30 October 2012 - 12:30 PM

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?

#1MisterFuzzy

Posted 30 October 2012 - 12:29 PM

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

PARTNERS