GameObj.destroy
Douglas Lacerda edited this page Aug 6, 2018
·
4 revisions
GameObj.destroy()
Remove the GameObj from the game loop.
Note: if the start method was not called then this will do nothing.
You can test this snippet of code here.
let txt = new Text("not destroyed", 10, 10, 100);
let time = 0;
new GameObj().update = function(){
if (time > 5){
txt.destroy();
}
time += Ramu.time.delta;
};
Ramu.init();