Learning Flash



The Game Loop

There is no real code for this one, just realization of how to arrange code for a flash game. It looks more or less like this:

// Set up  your variables and inital conditions here

// Variables and Stuff
var gameOn = 1;

// Now Enter the main Game Loop
onEnterFrame = function() {
   
    if ( gameOn == 1) {  // Then do the game loop, set gameOn =0 to stop loop from executing

       // Do all the Game Stuff here

           // To interrupt the loop and send the player somewhere else:
           gameOn = 0;
           gotoAndPlay(some other frame);

    }
}
stop();

Take a look at the code excerpts from the RadialSoloBall and eRadiRace to see this in use.

One Response to “Learning Flash”

Leave a Reply

(required)

(required)