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 MAX_SUB_DIVISIONS = 6, | |
MAX_OBJECTS = 6, | |
results = [], //results of multiple quads | |
OBJECT = "object", | |
NULL = null, | |
mc = Math.ceil; | |
function RTree() { | |
this.root = new Box(0, 0, 1600, 800, null, 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
SAT: function(poly1, poly2) { | |
var points1 = poly1.points, | |
points2 = poly2.points, | |
i = 0, l = points1.length, | |
j, k = points2.length, | |
normal = {x: 0, y: 0}, | |
length, | |
min1, min2, | |
max1, max2, | |
interval, |
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
SAT: function(poly1, poly2) { | |
var points1 = poly1.points, | |
points2 = poly2.points, | |
i = 0, l = points1.length, | |
j, k = points2.length, | |
normal = {x: 0, y: 0}, | |
length, | |
min1, min2, | |
max1, max2, | |
interval, |
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() { | |
var privateVar = 5; | |
Crafty.c('NewComponent', { | |
publicPropertyA: null, | |
publicPropertyB: 33, | |
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
this.test = function() { | |
var embeded = 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
#Performance Testing Framework | |
Performance is a very important factor for JavaScript games. It becomes | |
a cruciual factor when you bring mobile devices into the mix. | |
Luckily we have some great tools for testing different methods of coding | |
such as JSPerf.com. This lets developers see which browsers perform best | |
doing what. | |
On the same vein, JSGameBench stress tested rendering methods for browsers |
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(blog, limit) { | |
limit = +limit || 10; | |
var scriptTags = document.getElementsByTagName('script'); | |
var scriptNode = scriptTags[scriptTags.length - 1]; | |
var recent = document.createElement("div"); | |
scriptNode.parentNode.appendChild(recent); | |
recent.setAttribute("class", "widget"); | |
recent.setAttribute("id", "TumblrRecentPosts"); |
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
/** | |
* Shim the require function used in node.js | |
*/ | |
(function() { | |
if (window.require !== undefined) | |
throw 'RequireException: \'require\' already defined in global scope'; | |
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
/** | |
* @author Louis Stowasser <[email protected]> | |
* License: MIT | |
*/ | |
function generateTOC (rootNode, startLevel) { | |
var lastLevel = 0; | |
startLevel = startLevel || 2; //which H# tag to start indexing. | |
var html = "<ul>"; |
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 entityMap = { | |
"&": "&", | |
"<": "<", | |
">": ">", | |
'"': '"', | |
"'": ''', | |
"/": '/' | |
}; | |
function escapeHtml (string) { |
OlderNewer