A Flash Developer Resource Site

Results 1 to 8 of 8

Thread: Pausing

Hybrid View

  1. #1
    better than chuck norris
    Join Date
    Jun 2004
    Location
    West Coast of Michigan
    Posts
    667
    Code:
    gameplay = true;
    if (gameplay) {
         // gameworks
         // all code in here
         // the infamous pause below
         if (Key.isDown(Key.SPACE)) {
              gameplay = false;
         }
    }

  2. #2
    Hype over content... Squize's Avatar
    Join Date
    Apr 2001
    Location
    Lost forever in a happy crowd...
    Posts
    5,926
    It's much better using the one enterFrame mainloop approach rather than constantly checking a flag to see if a game is paused. It means [ Checking the flag way ] you're running a conditional check every frame which is only ever going to be needed 0.1% of the total time the game's running.

    To stop the mc's animating, I usually have all active sprites stored away somewhere, so just run a loop through them telling them to stop. Stops the 256 error if there's just too much content whizzing around.

    Squize.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center