Open Squishy123 opened 4 years ago
If an object leaves the specified boundaries, stop rendering/updating it. We can keep the object inside a seperate array to manage it in the event of the object being recalled.
if(actor.bounds outside_of stage.bounds) { this.children.remove(actor); this.gc.push(actor); }
Maybe something like this pseudocode.
Automatic garbage collection for objects outside of stage bounds
If an object leaves the specified boundaries, stop rendering/updating it. We can keep the object inside a seperate array to manage it in the event of the object being recalled.
Maybe something like this pseudocode.