Skip to content

Instantly share code, notes, and snippets.

View darrentorpey's full-sized avatar
❄️
one day at a time

Darren Torpey darrentorpey

❄️
one day at a time
  • Massachusetts, USA
View GitHub Profile
@darrentorpey
darrentorpey / _.md
Created October 8, 2012 21:50 — forked from anonymous/inlet.js
just another inlet to tributary
@darrentorpey
darrentorpey / gist:1020080
Created June 11, 2011 00:25 — forked from dariusk/gist:1019000
Explanation of tileCollision in Akihabara
/**
* Checks if the specified object is colliding with tiles in the map in an area defined by the object's colw and colh variables as well as the tolerance and approximation variables that are passed in through data. Only tiles in the map marked as solid are checked against. The alogrithm checks the
* @param {Object} th The object that is being checked against the tilemap.
* @param {Object} map This is the asci map that the tile map is generated from.
* @param {Object} tilemap This is the array of tile objects that it itterated over checking for collisions.
* @param {Object} defaulttile The default tile to be returned if nothing can be found. Null can be used here.
* @param {Object} data Passes is extra dat to the function. Can be set as null.
* <ul>
* <li>tolerance{Integer}: This is subtracted from the collision space to get the maximum collision area for the object. This defaults to 6.</li>
* <li>approximation{Integer}: This is the amount that the checked values are incremented by until they reach the maxim