This file contains 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
var TILEDMapClass = Class.extend({ | |
currMapData: null, | |
tilesets: [], | |
numXTiles: 100, | |
numYTiles: 100, | |
tileSize: { | |
"x": 64, |
This file contains 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
var TILEDMapClass = Class.extend({ | |
currMapData: null, | |
numXTiles: 100, | |
numYTiles: 100, | |
tileSize: { | |
"x": 64, | |
"y": 64 | |
}, |
This file contains 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
var TILEDMapClass = Class.extend({ | |
currMapData: null, | |
numXTiles: 100, | |
numYTiles: 100, | |
tileSize: { | |
"x": 64, | |
"y": 64 | |
}, | |
pixelSize: { |
This file contains 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
function xhrGet(reqUri,callback) { | |
var xhr = new XMLHttpRequest(); | |
xhr.open("GET", reqUri, true); | |
xhr.onload = callback; | |
xhr.send(); | |
} |
This file contains 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
var TILEDMapClass = Class.extend({ | |
fullyLoaded: false, | |
load: function (map) { | |
xhrGet(map, function(data) { | |
this.fullyLoaded = true; | |
}); | |
} | |
}); |
This file contains 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
var gSpriteSheets = {}; | |
SpriteSheetClass = Class.extend({ | |
img: null, | |
url: "", | |
sprites: [], | |
init: function () {}, |
This file contains 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
var gSpriteSheets = {}; | |
SpriteSheetClass = Class.extend({ | |
img: null, | |
url: "", | |
sprites: [], |
This file contains 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
var gSpriteSheets = {}; | |
SpriteSheetClass = Class.extend({ | |
img: null, | |
url: "", | |
sprites: new Array(), |
This file contains 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
var canvas = null; | |
var ctx = null; | |
var frameRate = 1000/30; | |
var frame = 0; | |
var assets = ['/media/img/gamedev/robowalk/robowalk00.png', | |
'/media/img/gamedev/robowalk/robowalk01.png', | |
'/media/img/gamedev/robowalk/robowalk02.png', | |
'/media/img/gamedev/robowalk/robowalk03.png', | |
'/media/img/gamedev/robowalk/robowalk04.png', | |
'/media/img/gamedev/robowalk/robowalk05.png', |
This file contains 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
var canvas = null; | |
var ctx = null; | |
var img = null; | |
var onImageLoad = function(){ | |
console.log("Image Loaded"); | |
ctx.drawImage(img, 192, 192); | |
canvas.appendChild(img); | |
}; |