actionscript 3 - To reset game, will I need to add objects dynamically? -


good evening/ morning.

i creating game in as3 enemies added not added dynamically.

if(hero attacks enemy) { parent.removechild(enemy) } 

when hero attacks enemy enemy removes self display list presume.

but when reset level, i.e go start menu , go level see enemies not in level, since they've been removed.

my question is, there way can reset display object in frame, in as2 refreshed flash movie. that's not in terms of coding shows not developing or learning.

if there no way, suggest adding objects removed, dynamically?

another question level in container.

//on stage, there movieclip called container.  //in container mc(movie clip) contains whole level, including platforms,   //enemies , props  

if remove prop container, in order reset game this

container.addchild(prop) //the question how set it's x , y position? 

thank you, appreciate every ones feedback , advice.

yes, remove them dynamically, need add them dynamically again in order reset them. either predefine positions , set them again, or can hide enemies , make them visible once again game resets. depends on code , structure.


Comments

Popular posts from this blog

apache - Remove .php and add trailing slash in url using htaccess not loading css -

javascript - jQuery show full size image on click -