// var stats = new Stats(); // stats.setMode(0); // stats.domElement.style.position = 'absolute'; // stats.domElement.style.left = '0px'; // stats.domElement.style.top = '0px'; // document.body.appendChild( stats.domElement ); var distance = function(p1, p2, c) { return c*tine.angleDistance(p1, p2)/360; } var DISTANCE = distance; var game = new tine.Game('config.json', { boot: function() { game.canvas.style['-webkit-touch-callout'] = 'none'; game.canvas.style['-webkit-user-select'] = 'none'; game.canvas.style['-khtml-user-select'] = 'none'; game.canvas.style['-moz-user-select'] = 'none'; game.canvas.style['-ms-user-select'] = 'none'; game.canvas.style['user-select'] = 'none'; game.canvas.style['-webkit-tap-highlight-color'] = 'rgba(0, 0, 0, 0)'; createjs.Sound.alternateExtensions = ["mp3"]; // Plugins game.plugins.add('control', ControlPlugin); game.registry = {current_level: 'tutorial1'} }, preload: function() { game.director.replace(new PreloadScene()); }, create: function() { game.sound.musicVolume = 0.3; game.registry.music = game.sound.playMusic('music', null, null, null, -1); game.ai = {'unit': new b3.BehaviorTree(), 'command': new b3.BehaviorTree()}; game.ai.unit.load(game.load.get('ai_unit'), AI); game.ai.command.load(game.load.get('ai_command'), AI); // Settings game.data = game.load.get('data_settings'); game.data.playerStructures = game.load.get('data_player_structures'); game.data.enemyStructures = game.load.get('data_enemy_structures'); game.data.playerUnits = game.load.get('data_player_units'); game.data.enemyUnits = game.load.get('data_enemy_units'); game.sound.addSound('sfx_hit1', 'hit'); game.sound.addSound('sfx_hit2', 'hit'); game.sound.addSound('sfx_hit3', 'hit'); game.sound.addSound('sfx_hit4', 'hit'); game.sound.addSound('sfx_hit5', 'hit'); game.sound.addSound('sfx_hit6', 'hit'); game.sound.addSound('sfx_hit7', 'hit'); game.sound.addSound('sfx_landing1', 'landing'); game.sound.addSound('sfx_landing2', 'landing'); game.sound.addSound('sfx_explosion1', 'explosion'); game.sound.addSound('sfx_explosion2', 'explosion'); game.sound.addSound('sfx_explosion3', 'explosion'); game.sound.addSound('sfx_explosion4', 'explosion'); game.sound.addSound('sfx_explosion5', 'explosion'); game.sound.addSound('sfx_select1', 'select'); game.sound.addSound('sfx_select2', 'select'); game.sound.addSound('sfx_select3', 'select'); game.sound.addSound('sfx_fall1', 'fall'); game.sound.addSound('sfx_fall2', 'fall'); game.sound.addSound('sfx_fall3', 'fall'); game.sound.addSound('sfx_die1', 'die'); game.sound.addSound('sfx_die2', 'die'); game.sound.addSound('sfx_die3', 'die'); game.sound.addSound('sfx_die4', 'die'); game.sound.addSound('sfx_victory1', 'victory'); game.sound.addSound('sfx_victory2', 'victory'); game.sound.addSound('sfx_victory3', 'victory'); // Create scenes here... game.director.add('menu', new MenuScene()); game.director.add('level', new LevelScene()); game.director.add('test', new TestScene()); game.director.add('pause', new PauseScene()); game.director.add('win', new WinScene()); game.director.add('intro', new IntroScene()); game.director.add('credits', new CreditsScene()); game.director.add('selection', new SelectionScene()); // Replace preload with next scene... // // game.director.replace('level')//, new tine.transitions.Scroll()) game.director.push('menu', new tine.transitions.FadeInOut(null, 600)) // game.director.replace('level') // game.director.replace('credits') }, update: function() { // stats.begin(); }, draw: function () { // stats.end(); } }); // {"id":"imageg", "src":"http://media-cdn.tripadvisor.com/media/photo-s/01/77/cf/39/big-sur-pfeiffer-sp.jpg"}, // {"id":"image4", "src":"http://media-cdn.tripadvisor.com/media/photo-s/01/1f/a9/03/big-sur-coast.jpg"}, // {"id":"imagee", "src":"http://twimgs.com/informationweek/galleries/automated/981/Big_Hadoop_01_full.jpg"}, // {"id":"imagez", "src":"http://www.o2thinkbig.co.uk/Global/o2-think-big21-e1347354794155.jpg"}, // {"id":"imagez1", "src":"http://blogs.telegraph.co.uk/news/files/2013/01/big-data.jpg"}