add persistent ship fragments

Create issue
Issue #239 resolved
Riot created an issue

like normal ship fragments, but get destroyed on impact - with both player and enemies and asteroids and portals - and make them persist indefinitely.

They could trail a little bit of fire continuously too.

Have them reference counted, with a max limit, and clear them up on sphere exit by giving them a "bool destroyed_on_sphere_exit()" polymorphic function, and looping through those. Bullets should be given this property, as well. Don't actually clear them on exit, but once a sphere has been left, iterate through its objects and add them to a global list of such entities to be cleared up. Then in the update loop, periodically pop something out of this list at random, at a rate proportional to the size of the list. Here's a fast random remove function to use on a vector:

Comments (4)

  1. Log in to comment