Project-Rekt / engine

Game Engine - Currently on version MASON
https://project-rekt.github.io/engine/index.html
Apache License 2.0
1 stars 3 forks source link

Automatic garbage collection for objects outside of stage bounds #15

Open Squishy123 opened 4 years ago

Squishy123 commented 4 years ago

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.

if(actor.bounds outside_of stage.bounds) {
    this.children.remove(actor);
    this.gc.push(actor);
}

Maybe something like this pseudocode.