Created
September 29, 2010 20:31
-
-
Save sjakaus/603491 to your computer and use it in GitHub Desktop.
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 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