Last active
August 29, 2015 14:04
-
-
Save CharlotteGore/6d0212642d8e0a15e906 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// namespace.js - first file you load... | |
(function (){ | |
var TIGERWORLD = {}; | |
window.TIGERWORLD = TIGERWORLD; | |
})(); | |
// tiger.js - load this after namespace.js... | |
(function (TIGERWORLD){ | |
function Tiger (){ | |
} | |
Tiger.prototype = ... | |
// add your Tiger prototype to the GAEM namespace... | |
TIGERWORLD.Tiger = Tiger; | |
})(TIGERWORLD); | |
// run-the-game.js - load this LAST! | |
(function (TIGERWORLD){ | |
var tiger = new TIGERWORLD.Tiger(); | |
tiger.doExcitingThings(); | |
})(TIGERWORLD); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment