If simply not drawing it when its health is 0 isn't enough, you can just set the variable to null. This won't affect the memory immediately, but since JavaScript is garbage collected, unless you have multiple global references to it, it will eventually get deleted when space is needed
Bálint
- 15.1k
- 2
- 38
- 57