public/javascripts/nodegame-full.js
function setupTimer(opts) {
                var name, timer;
                name = opts.name || node.game.timer.name;
                timer = node.timer.getTimer(name);

                if (!timer) {
                    node.warn('setup("timer"): timer not found: ' + name);
                    return false;
                }

                if (opts.options) timer.init(opts.options);

                switch (opts.action) {
                case 'start':
                    timer.start();
                    break;
                case 'stop':
                    timer.stop();
                    break;
                case 'restart':
                    timer.restart();
                    break;
                case 'pause':
                    timer.pause();
                    break;
                case 'resume':
                    timer.resume();
                }

                return true;
            }
function setupTimer(opts) {
                var name, timer;
                name = opts.name || node.game.timer.name;
                timer = node.timer.getTimer(name);

                if (!timer) {
                    node.warn('setup("timer"): timer not found: ' + name);
                    return false;
                }

                if (opts.options) timer.init(opts.options);

                switch (opts.action) {
                case 'start':
                    timer.start();
                    break;
                case 'stop':
                    timer.stop();
                    break;
                case 'restart':
                    timer.restart();
                    break;
                case 'pause':
                    timer.pause();
                    break;
                case 'resume':
                    timer.resume();
                }

                return true;
            }
function setupTimer ( opts ) { var name , timer ; name = opts . name || node . game . timer . name ; timer = node . timer . getTimer ( name ) ; if ( ! timer ) { node . warn ( 'setup("timer"): timer not found: ' + name ) ; return false ; } if ( opts . options ) timer . init ( opts . options ) ; switch ( opts . action ) { case 'start' : timer . start ( ) ; break ; case 'stop' : timer . stop ( ) ; break ; case 'restart' : timer . restart ( ) ; break ; case 'pause' : timer . pause ( ) ; break ; case 'resume' : timer . resume ( ) ; } return true ; }
Helper function to setup a single timer.
Helper function to setup a single timer .