Skip to content

Instantly share code, notes, and snippets.

View louisstow's full-sized avatar

Louis Stowasser louisstow

View GitHub Profile
this.test = function() {
var embeded = true;
};
(function() {
var privateVar = 5;
Crafty.c('NewComponent', {
publicPropertyA: null,
publicPropertyB: 33,
init: function(){
@louisstow
louisstow / SAT.js
Created February 15, 2011 07:04
SAT Collision
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,
@louisstow
louisstow / SAT.js
Created February 2, 2011 04:46
SAT collision detection in JS
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,
@louisstow
louisstow / RTree.js
Created November 14, 2010 05:41
Javascript RTree
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);
}