PageRenderTime 52ms CodeModel.GetById 30ms app.highlight 2ms RepoModel.GetById 18ms app.codeStats 0ms

/js/BubbleDots/script.js

http://github.com/onedayitwillmake/RealtimeMultiplayerNodeJs
JavaScript | 31 lines | 16 code | 9 blank | 6 comment | 2 complexity | 66e6418dbb6318c637fc4eb71858bf95 MD5 | raw file
 1(function () {
 2    // Callback for when browse is ready
 3    var onDocumentReady = function () {
 4        var that = this;
 5
 6        // Preload images
 7        var imagePreloader = new CAAT.ImagePreloader();
 8
 9        // Callback for image preloader
10        imagePreloader.loadImages(BubbleDots.Constants.IMAGE_ASSETS, function (counter, images) {
11
12            BubbleDots.DemoClientGame.prototype.log("Preloading image...");
13
14            if (counter != images.length) return;
15
16            BubbleDots.IMAGE_CACHE = images;
17
18            // Image preload complete - START THE GAME!
19            var clientGame = new BubbleDots.DemoClientGame(images);
20        });
21    };
22
23
24    // Adjust aside to match game dimensions
25    var newHeight = BubbleDots.Constants.GAME_HEIGHT;
26    newHeight -= parseFloat($("aside").css("padding-top")) * 2;
27    $("aside").height(newHeight + "px");
28
29    // Listen for ready
30    window.addEventListener('load', onDocumentReady, false);
31})();