Runs on the Ancient Brain system have the following global variable defined:

 ABRun;            // instance of class ABRunClass    

The ABRun object starts and manages the run itself. It has the following public interface (default values shown):

ABRun.runReady = true;      // Are we ready to go into the run loop? 

   // This is useful when a World loads resources from files.
   // We often prefer to load all resources first, before the run loop starts.
   // To do this:
   // In World.newRun(), set ABRun.runReady = false, and then start load resources.
   // When load finished, set ABRun.runReady = true and run loop will start.
   // This is also useful if there is a splash screen. 
   // Pause the run loop until the user dismisses the splash screen.
ABRun.step;					// the step of the run loop 

ABRun.abortRun = false;     // set this to true anytime to end the run early 

ABRun.world;                // The World in this run
ABRun.mind;                 // The Mind in this run

// The above two handles are useful if you want to put HTML controls on your page 
// that directly call functions in the World or Mind, like:
// <button onclick='ABRun.world.fn();' 

The background is a program, showing the JavaScript graphics used on this site.

© Ancient Brain Ltd. 2018-19. All rights reserved.

Ancient Brain ™ is a trademark of Ancient Brain Ltd.

Platforms      Bug bounty      Contact

Stats      The name      Terms and conditions

Classes in Dublin      Call for partners