Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //this is all the information on how my game pause. If it is of any use, I'm using A.P.E. as a base.
- public class Global
- {
- public static var CurrentWorld:World;
- }
- public class Game extends World
- {
- override public function begin():void
- {
- Global.level = 0;
- nextlevel();
- }
- override public function update():void
- {
- if (Input.pressed(Global.keyR)) //Pause or unpause the game
- {
- gotoMenu();
- }
- }
- protected function gotoMenu ():void
- {
- Global.CurrentWorld = this;
- FP.world = new pmenu;
- }
- public class pmenu extends World
- {
- public function pmenu()
- {
- var screencap:Image = new Image(FP.buffer.clone());
- addGraphic(screencap, 10);
- FP.tween(screencap, {alpha: 0}, 30, {ease:Ease.sineOut, tweener:this});
- }
- override public function update():void
- {
- if ( Input.pressed( Global.keyR ) ) { unpause();}
- }
- protected function unpause():void
- {
- FP.world = Global.CurrentWorld;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement