Advertisement
Guest User

Untitled

a guest
Jul 17th, 2017
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.20 KB | None | 0 0
  1. //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.
  2.  
  3. public class Global
  4. {
  5. public static var CurrentWorld:World;
  6. }
  7.  
  8. public class Game extends World
  9. {
  10. override public function begin():void
  11. {
  12.  
  13. Global.level = 0;
  14.  
  15. nextlevel();
  16. }
  17.  
  18. override public function update():void
  19. {
  20. if (Input.pressed(Global.keyR)) //Pause or unpause the game
  21. {
  22. gotoMenu();
  23. }
  24. }
  25.  
  26. protected function gotoMenu ():void
  27. {
  28. Global.CurrentWorld = this;
  29. FP.world = new pmenu;
  30. }
  31. public class pmenu extends World
  32. {
  33. public function pmenu()
  34. {
  35. var screencap:Image = new Image(FP.buffer.clone());
  36. addGraphic(screencap, 10);
  37. FP.tween(screencap, {alpha: 0}, 30, {ease:Ease.sineOut, tweener:this});
  38. }
  39. override public function update():void
  40. {
  41. if ( Input.pressed( Global.keyR ) ) { unpause();}
  42. }
  43.  
  44. protected function unpause():void
  45. {
  46. FP.world = Global.CurrentWorld;
  47. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement