Google Closure Library - Nintendo Game Development

Published on Thursday, September 26, 2013

Description

Before we start writing our 2D game engine in JavaScript for the Nintendo Wii U, I need to explain how to use the closure library. This tutorial shows you how to use Google Closure Library, which makes jQuery, MooTools, Dojo, and other JavaScript libraries and frameworks look like... Q-Basic compared to C++. The first step is to actually download the library from its Google Code source at http://code.google.com/p/closure-library Then make sure you have access to this from your server (from the client). What you need to do is include .../closure/goog/base.js, which will bootstrap the rest of the application. The backbone of closure library is the module system we can create using goog.provide and goog.require. Before the library can know how to import files that you goog.require, you will need to create a dependency file (deps.js be convention), which can be done using one of the Python scripts included in the library. With that in place, base.js can load each file synchronously as a goog.require is encountered, provided that the file is not yet loaded into the execution environment. After the application is ran through the closure compiler, all of the files required are compiled out into a single highly optimized output file.

Copyright © 2014-2017 EasyLearnTutorial. All rights reserved.