- https://github.com/batiste/sprite.js - sprite animation framework
- http://renderengine.com/
- http://gamequery.onaluf.org/ - designed to be used with jQuery
-
- tile based
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
'use strict'; | |
let assert = (condition) => { | |
if (!condition) throw new Error('assertion error') | |
} | |
let sum = (_,a,b) => a+b | |
let mul = (_,a,b) => a*b | |
let sub = (_,a,b) => a-b | |
let div = (_,a,b) => a/b |
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
application:open-your-keymap | |
application:open-your-stylesheet | |
autocomplete:attach | |
autoflow:reflow-paragraph | |
bookmarks:clear-bookmarks | |
bookmarks:jump-to-next-bookmark | |
bookmarks:jump-to-previous-bookmark | |
bookmarks:toggle-bookmark | |
bookmarks:view-all | |
check:correct-misspelling |
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 rgbToHex(r, g, b) { | |
var ret; | |
return [ r, g, b ].map( function(val) { | |
ret = val.toString(16); | |
return ret.length == 1 ? "0" + ret : ret; | |
}).join(""); | |
} |
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
//FightCode can only understand your robot | |
//if its class is called Robot | |
var Robot = function(robot) { | |
}; | |
Robot.prototype.onIdle = function(ev) { | |
var robot = ev.robot; | |
robot.ahead(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
function resolveCollisions() { | |
var collision = world.m_contactList; | |
if (!collision) return; | |
var obj1 = collision.GetShape1(); | |
var obj2 = collision.GetShape2(); | |
if ( (obj1.m_body.m_shapeList.renderType == "player" && obj2.m_body.m_shapeList.renderType == "exit") || |
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
// this code sux. | |
(function() { | |
function getKeys(object) { | |
var keys = []; | |
for (var key in object) { | |
if (!key.match(/^_Firebug/)) { | |
keys.push(key); | |
} | |
} |
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
pilkowski@dev:~$ npm ls | grep yui3 | |
└─┬ [email protected] | |
└── [email protected] | |
pilkowski@dev:~$ node -v | |
v0.4.8 | |
pilkowski@dev:~$ npm -v | |
1.0.13 | |
pilkowski@dev:~$ node | |
> var y = require('yui3') | |
> !!y |
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 sth1 = {}, sth2 = {}; | |
sth1.x = 10; // x pos | |
sth1.y = 10; // y pos | |
sth1.r = 10; // radius | |
sth2.x = 15; // x pos | |
sth2.y = 15; // y pos | |
sth2.r = 10; // radius |
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 MyClass; | |
(function() { | |
MyClass = function() { | |
this.val = 2; | |
} | |
MyClass.prototype.publicFunction = function() { | |
return privateFunction.call(this); | |
} | |
privateFunction = function() { | |
return this.val + " is the value of val"; |