I have a game involving a laser object. Throughout the course of the game, one laser at a time can be fired, and the laser has the ability to reflect off certain things. The laser instance handles all it’s own movements and reflections. I would like to get rid of each laser instance after it collides (not real collisions) with an object, or after it runs out of reflections.
I’m trying to avoid continually allocating more and more memory every time a laser is created. Is there any way to have a laser instance kill itself?