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
GameEngineClass = Class.extend({ | |
move_dir: new Vec2(0,0), | |
dirVec: new Vec2(0,0), | |
gPlayer0: { | |
pos: { | |
x: 100, | |
y: 100 | |
}, |
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
GameEngineClass = Class.extend({ | |
move_dir: new Vec2(0,0), | |
dirVec: new Vec2(0,0), | |
gPlayer0: { | |
pos: { | |
x: 100, | |
y: 100 | |
}, |
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
InputEngineClass = Class.extend({ | |
bindings: {}, | |
actions: {}, | |
mouse: { | |
x: 0, | |
y: 0 | |
}, |
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
InputEngineClass = Class.extend({ | |
keyState: new Array(256), | |
//----------------------------- | |
setup: function () { | |
document.getElementById('my_canvas').addEventListener('mousemove', this.onMouseMove); | |
document.getElementById('my_canvas').addEventListener('keydown', this.onKeyDown); | |
document.getElementById('my_canvas').addEventListener('keyup', this.onKeyUp); | |
}, |
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 setup() { | |
var canvas = document.getElementById('my_canvas'); | |
canvas.addEventListener('mousemove', onMouseMove); | |
canvas.addEventListener('keydown', onKeyDown); | |
} | |
function onMouseMove(event) { | |
var posX = event.clientX; | |
var posY = event.clientY; | |
return posX; |
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({ | |
// This is where we store the full parsed | |
// JSON of the map.json file. | |
currMapData: null, | |
// tilesets stores each individual tileset | |
// from the map.json's 'tilesets' Array. | |
// The structure of each entry of this | |
// Array is explained below in the | |
// parseAtlasDefinition method. |
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, | |
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, | |
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, | |
tilesets: [], | |
numXTiles: 100, | |
numYTiles: 100, | |
tileSize: { | |
"x": 64, |