
//developed by Kush Bharadwaj

"use strict";
var Game = function($) {
	return {
		config : {
			width : 480,
			height : 280,
		},

		
		initialize : function() {
			Crafty.init();
			Crafty.canvas.init();

			Crafty.stage.fullscreen=true;
			Crafty.background('rgb(255,255,255)')

			screen.mozLockOrientation("landscape-primary");

			if(Crafty.mobile){
				//console.log("MOBILE VERSION");
			}
			else {
				//console.log("NOT MOBILE VERSION");
			}
			
				

            Crafty.load(["images/tt_Logo.png",  "images/title.png", "images/star.png", "images/star1.png",
                         "images/shell.png", "images/shell1.png", "images/ingame_bg2.png", "images/menu_bg.png",
                         "images/selectingscreem.png", "images/aboutus1.png", "images/aboutus2.png", "images/aboutus3.png",
                         "images/aboutus4.png", "images/back1.png", "images/back2.png", "images/bot.png",
                         "images/help1.png", "images/help2.png", "images/help3.png", "images/line1.png",
                         "images/line2.png", "images/line3.png", "images/line4.png", "images/line5.png",
                         "images/line6.png", "images/mainmenu1.png", "images/mainmenu2.png", "images/newgame1.png",
                         "images/newgame2.png", "images/pause1.png", "images/pause2.png", "images/pause3.png",      
                         "images/player.png", "images/player1.png", "images/player2.png", "images/resume1.png",     
                         "images/resume2.png", "images/pop_up.png", "images/selectobject.png", "images/sngleplayer1.png", 
                         "images/sngleplayer2.png", "images/soundoff.png", "images/soundon.png", "images/twoplayer1.png", 
                         "images/twoplayer2.png", "images/you_lost.png", "images/you_won.png", "images/you_wonplayer1.png", 
                         "images/you_wonplayer2.png",  "images/gamedraw.png", "images/playagain1.png",
                         "images/playagain2.png", "images/tryagain1.png", "images/tryagain2.png", "images/tile_select.png",
                         "images/help_screen1.png", "images/selectobject1.png", "images/masking1.png",
                         "images/botturn.png", "images/playerturn.png", "images/player2turn.png", "images/player1turn.png"], 
		                
                        function() { 
		                   console.log("***************************************")
		                   console.log(" all assets are loaded ")
		                   console.log("***************************************")
		                   Crafty.scene('TTSplash');
		                   
		                },
		                function(e) {
		                   // console.log("progress ", e.total, e.loaded)
		                },

		                function(e) {
		                	//console.log("")
		                	
		                }

		               ) 

			    loadAudio();
			
		},

	};

}($);


