Skip to content

Instantly share code, notes, and snippets.

View gist:f35ab6d095fd0d9720a214dd6f896237
### Keybase proof
I hereby claim:
* I am edzillion on github.
* I am edzillion (https://keybase.io/edzillion) on keybase.
* I have a public key ASDanXpVW4PT67xtoLL0soq41pnCLuD-mfhyhu0aiucqzwo
To claim this, I am signing this object:
View gist:4349423
Level.prototype.preloadGraphics = function() {
//create deferred object. this will stop this function from returning until all our graphics are loaded
var dfr = new $.Deferred();
var remaining = this.graphicsdata.length;
for (var i = 0; i < this.graphicsdata.length; i++) {
var img = new Image();
img.src = this.graphicsdata[i].src;
img.data = this.graphicsdata[i];
View gist:4349128
{
"creeps": [
{
"name": "green_wizard",
"type": "creeps",
"src": "wizard.png",
"framewidth": 46,
"frameheight": 64,
"frames": 32,
"regx": 23,
View gist:4348984
//load the original wizard spritesheet
var img = new Image();
img.src = 'wizard.png';
img.onload = function() {
//we need an array to hold the filtered spritesheets, and we add 'this' spritesheet first
var imgArray = Array();
imgArray.push(this);
//next we create the ColorFilters
View gist:4348144
<script type="text/javascript" src="./assets/libs/easeljs-0.5.0.min.js"></script>
<script type="text/javascript" src="./assets/libs/ColorFilter.js"></script>
You can’t perform that action at this time.