Difference between revisions of "Sic/frame4.as"
({{as}}) |
(legacy) |
||
Line 1: | Line 1: | ||
+ | {{legacy}} | ||
+ | <as> | ||
// | // | ||
// Liscenced under LGPL: www.gnu.org/copyleft/lesser.html | // Liscenced under LGPL: www.gnu.org/copyleft/lesser.html | ||
− | // | + | // |
// Nad - 2003 - SIC-Games | // Nad - 2003 - SIC-Games | ||
// | // | ||
Line 34: | Line 36: | ||
} | } | ||
else demo._visible = game._visible = environment._visible = false; | else demo._visible = game._visible = environment._visible = false; | ||
+ | </as> | ||
+ | [[Category:ActionScript]] |
Revision as of 23:44, 24 September 2013
<as> // // Liscenced under LGPL: www.gnu.org/copyleft/lesser.html // // Nad - 2003 - SIC-Games // // Frame4: PER-FRAME
now = new Date(); time = now.getTime();
processOutgoingEvents(); // Propagate any accumulated local events processIncomingEvents(); // Execute events needing instantiation this frame // Periodically attempt connection // - first connection attempt is after delay so that peers are all connected if (!network.connected && ++network.ctr%1000 == 999) network.connect('127.0.0.1', network.port);
if (shell.state != 2) {
// Execute frame() for environment environment._visible = true; environment.frame();
// Execute frame() for active spaces - which in turn calls frame() of objects it contains
for (var i = 0; i < allSpaces.length; i++) if (allSpaces[i].active) allSpaces[i].frame();
// Demo mode (screensaver) if ((environment.phase < 10)&&(time - environment.lastActivity) > environment.timeout) { environment.time = time; environment.phase = 10; }
} else demo._visible = game._visible = environment._visible = false; </as>