Newbie Asks: How do you destroy Actor once Out of screen
Posted: Wed Apr 25, 2012 8:48 pm
I read the OPTIMIIZATION techniques thread and they said
you should destroy the actors once they're not visible in the screen.
So for example, my planeed game is a mario style side scrolling game.
So my question is
once i pass the screen and the enemy or whatever is not visible any more
AND Also if the player destroys (by punching or whatever) an enemy, i should destroy them right?
How do i do that? Do i do it in the script editor?
And how?
Just a wild guess is:
in the script editor for the enemy, when player has punching animation and he is coliding with me( the enemy) and I'm(the enemy) not blocking, add to the GOTHIT Counter and if it equals 5 then I die--> DestroyActor( "event Actor");
OR If I'm(the enemy) still alive, but not visible in screen anymore--> DestroyActor("event actor");
Is this how to do it?
you should destroy the actors once they're not visible in the screen.
So for example, my planeed game is a mario style side scrolling game.
So my question is
once i pass the screen and the enemy or whatever is not visible any more
AND Also if the player destroys (by punching or whatever) an enemy, i should destroy them right?
How do i do that? Do i do it in the script editor?
And how?
Just a wild guess is:
in the script editor for the enemy, when player has punching animation and he is coliding with me( the enemy) and I'm(the enemy) not blocking, add to the GOTHIT Counter and if it equals 5 then I die--> DestroyActor( "event Actor");
OR If I'm(the enemy) still alive, but not visible in screen anymore--> DestroyActor("event actor");
Is this how to do it?