Home Tutorials Forums Articles Blogs Movies Library Employment Press
Old 05-28-2011, 05:54 PM   #1
jaggernought
Registered User
 
Join Date: Apr 2011
Location: England, United Kingdom
Posts: 40
Default [AS3] Reset Game

I've got my "Engine" class that adds everything in the game to the stage.
How can I make it so that when the player dies the game restarts and goes back to the main menu.

Is there an easy way to do this or do I have to use remove child on everything

Thanks
jaggernought is offline   Reply With Quote
Old 05-30-2011, 12:33 AM   #2
tadster
tadster
 
tadster's Avatar
 
Join Date: Feb 2009
Location: Texas
Posts: 2,111
Default

Add things to the engine not the stage, and then when you need to switch to another screen you just remove the engine from the stage, or even just cover it with the other screen.

Remember also that there are added_to_stage and removed_from_stage events.
__________________
www.actiontad.com - ActionScript and JavaScript sitting in a tree...

Last edited by tadster; 05-30-2011 at 12:37 AM.
tadster is offline   Reply With Quote
Reply


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 06:55 PM.

///
Follow actionscriptorg on Twitter

 


Powered by vBulletin® Version 3.8.5
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Ad Management plugin by RedTyger
Copyright 2000-2013 ActionScript.org. All Rights Reserved.
Your use of this site is subject to our Privacy Policy and Terms of Use.