Skip to content

Instantly share code, notes, and snippets.

View caubry's full-sized avatar
🌵

Caroline Aubry caubry

🌵
View GitHub Profile
var TILEDMapClass = Class.extend({
currMapData: null,
tilesets: [],
numXTiles: 100,
numYTiles: 100,
tileSize: {
"x": 64,
var TILEDMapClass = Class.extend({
currMapData: null,
numXTiles: 100,
numYTiles: 100,
tileSize: {
"x": 64,
"y": 64
},
var TILEDMapClass = Class.extend({
currMapData: null,
numXTiles: 100,
numYTiles: 100,
tileSize: {
"x": 64,
"y": 64
},
pixelSize: {
function xhrGet(reqUri,callback) {
var xhr = new XMLHttpRequest();
xhr.open("GET", reqUri, true);
xhr.onload = callback;
xhr.send();
}
var TILEDMapClass = Class.extend({
fullyLoaded: false,
load: function (map) {
xhrGet(map, function(data) {
this.fullyLoaded = true;
});
}
});
var gSpriteSheets = {};
SpriteSheetClass = Class.extend({
img: null,
url: "",
sprites: [],
init: function () {},
var gSpriteSheets = {};
SpriteSheetClass = Class.extend({
img: null,
url: "",
sprites: [],
var gSpriteSheets = {};
SpriteSheetClass = Class.extend({
img: null,
url: "",
sprites: new Array(),
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',
var canvas = null;
var ctx = null;
var img = null;
var onImageLoad = function(){
console.log("Image Loaded");
ctx.drawImage(img, 192, 192);
canvas.appendChild(img);
};