/js/BubbleDots/script.js
JavaScript | 31 lines | 16 code | 9 blank | 6 comment | 2 complexity | 66e6418dbb6318c637fc4eb71858bf95 MD5 | raw file
Possible License(s): GPL-2.0, LGPL-2.1, MPL-2.0-no-copyleft-exception, BSD-3-Clause
- (function () {
- // Callback for when browse is ready
- var onDocumentReady = function () {
- var that = this;
- // Preload images
- var imagePreloader = new CAAT.ImagePreloader();
- // Callback for image preloader
- imagePreloader.loadImages(BubbleDots.Constants.IMAGE_ASSETS, function (counter, images) {
- BubbleDots.DemoClientGame.prototype.log("Preloading image...");
- if (counter != images.length) return;
- BubbleDots.IMAGE_CACHE = images;
- // Image preload complete - START THE GAME!
- var clientGame = new BubbleDots.DemoClientGame(images);
- });
- };
- // Adjust aside to match game dimensions
- var newHeight = BubbleDots.Constants.GAME_HEIGHT;
- newHeight -= parseFloat($("aside").css("padding-top")) * 2;
- $("aside").height(newHeight + "px");
- // Listen for ready
- window.addEventListener('load', onDocumentReady, false);
- })();