Skip to content

Instantly share code, notes, and snippets.

@yornaath
Created July 5, 2011 11:47
Show Gist options
  • Save yornaath/1064698 to your computer and use it in GitHub Desktop.
Save yornaath/1064698 to your computer and use it in GitHub Desktop.
function handleSplashDrawing() {
for (var i = 0; i < ships.length; i++) {
if (shipsLoaded) {
ships[i]["currFrame"]++;
if (ships[i]["currFrame"] >= ships[i]["numFrames"]) {
ships[i]["currFrame"] = 0;
}
//var ctx = $(ships[i]["canvas"])[0].getContext("2d");
//ctx.clearRect(0, 0, ships[i]["frameWidth"], ships[i]["frameHeight"]);
//ctx.drawImage(ships[i]["frameCanvases"][ships[i]["currFrame"]], 0, 0);
$(ships[i]["canvas"]).html(ships[i]["frameCanvases"][ships[i]["currFrame"]]);
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment