

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

        initialize : function() {
			// init Crafty
            Crafty.init();
            Crafty.canvas.init();
			// set background
            Crafty.background('rgb(255,255,255)')
           // screen.mozLockOrientation("portrait");

            if(Crafty.mobile){
                console.log("MOBILE VERSION");
                Crafty.stage.fullscreen=true;
            }
            else {
                console.log("NOT MOBILE VERSION");
            }
            
            Crafty.load([ "images/tt_Logo.png", "images/Splash screan.png", "images/aboutBg.png", 
                         "images/card_background.png", "images/Club_2.png", "images/Club_3.png",
                         "images/Club_4.png", "images/Club_9.png", "images/Club_5.png", "images/Club_6.png",
                         "images/Club_7.png", "images/Club_8.png", "images/Club_10.png", "images/Club_jack.png",
                         "images/Club_queen.png", "images/Club_king.png", "images/Club_ace.png", 
                         "images/Diamond_2.png", "images/Diamond_3.png", "images/Diamond_4.png", "images/Diamond_9.png", 
                         "images/Diamond_5.png", "images/Diamond_6.png", "images/Diamond_7.png", "images/Diamond_8.png",
                         "images/Diamond_10.png","images/Diamond_jack.png", "images/Diamond_queen.png", 
                         "images/Diamond_king.png", "images/Diamond_ace.png",
                         "images/Heart_2.png", "images/Heart_3.png", "images/Heart_4.png", "images/Heart_9.png",
                         "images/Heart_5.png", "images/Heart_6.png", "images/Heart_7.png", "images/Heart_8.png", 
                         "images/Heart_10.png", "images/Heart_jack.png", "images/Heart_queen.png", 
                         "images/Heart_king.png", "images/Heart_ace.png",
                         "images/Spade_2.png", "images/Spade_3.png", "images/Spade_4.png", "images/Spade_9.png",    
                         "images/Spade_5.png", "images/Spade_6.png", "images/Spade_7.png", "images/Spade_8.png", 
                         "images/Spade_10.png", "images/Spade_jack.png", "images/Spade_queen.png",
                         "images/Spade_king.png", "images/Spade_ace.png", "images/pause_1.png", "images/pause_2.png",
                         "images/deck_background.png", "images/menubg.png", "images/inGameBg.png", "images/about_1.png",
                         "images/about_2.png", "images/back_image.png", "images/help_1.png", "images/help_2.png",
                         "images/helpBg.png", "images/new_game_1.png", "images/new_game_2.png", "images/resume_1.png",
                         "images/resume_2.png", "images/sound_off.png", "images/sound_on.png", "images/Main menu.png",
                         "images/Main_menu_2.png", "images/no_1.png", "images/no.png", "images/yes_1.png",
                         "images/yes_2.png", "images/congratilation.png", "images/exitmainmenu.png", 
                         "images/restart_1.png", "images/restart_2.png",                   
                                            
                        ], 
                            
                         function() { 
                             console.log("***************************************")
                             console.log(" all assets are loaded ")
                             console.log("***************************************")
                             loadAudio();
                             Crafty.scene('TTSplash');
                                   
                         },
                
                         function(e) {
                             //     console.log("progress ", e.total, e.loaded)
                         }
                         ) 
                         
                        
        },

    };
    
}($);





