Skip to content

Instantly share code, notes, and snippets.

@sjakaus
Created September 29, 2010 20:31
Show Gist options
  • Save sjakaus/603491 to your computer and use it in GitHub Desktop.
Save sjakaus/603491 to your computer and use it in GitHub Desktop.
//this is part of level.as
var collisionGrid:Grid = new Grid(97,97,16,16);
collisionGrid.usePositions = true;
collisionGrid.setRect(0,0,90,90,true);
mask = collisionGrid;
//and this is in the update method of player.as
if(collide("level",x,y))
{
trace("collision! ("+x+","+y+")");
y = oldy;
x = oldx;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment