PageRenderTime 36ms CodeModel.GetById 18ms RepoModel.GetById 1ms 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
Possible License(s): GPL-2.0, LGPL-2.1, MPL-2.0-no-copyleft-exception, BSD-3-Clause
  1. (function () {
  2. // Callback for when browse is ready
  3. var onDocumentReady = function () {
  4. var that = this;
  5. // Preload images
  6. var imagePreloader = new CAAT.ImagePreloader();
  7. // Callback for image preloader
  8. imagePreloader.loadImages(BubbleDots.Constants.IMAGE_ASSETS, function (counter, images) {
  9. BubbleDots.DemoClientGame.prototype.log("Preloading image...");
  10. if (counter != images.length) return;
  11. BubbleDots.IMAGE_CACHE = images;
  12. // Image preload complete - START THE GAME!
  13. var clientGame = new BubbleDots.DemoClientGame(images);
  14. });
  15. };
  16. // Adjust aside to match game dimensions
  17. var newHeight = BubbleDots.Constants.GAME_HEIGHT;
  18. newHeight -= parseFloat($("aside").css("padding-top")) * 2;
  19. $("aside").height(newHeight + "px");
  20. // Listen for ready
  21. window.addEventListener('load', onDocumentReady, false);
  22. })();