Skip to content

Instantly share code, notes, and snippets.

@hughfdjackson
Created January 13, 2012 12:09
Show Gist options
  • Select an option

  • Save hughfdjackson/1605798 to your computer and use it in GitHub Desktop.

Select an option

Save hughfdjackson/1605798 to your computer and use it in GitHub Desktop.
void function(){
var images = {} // where we're keeping our images
function image_callback(i){
// copy any loaded images over to the images object
for ( var prop in i ) {
images[prop] = i[prop]
}
// DO WHATEVER LOGIC YOU NEED TO DO ONLOAD -- important! it must go here.
}
load_images({ ground: "images/ground.png" }, image_callback)
load_image({ player: "images/player.png", blah: "foo.jpg" }, image_callback)
}()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment