Skip to content

Instantly share code, notes, and snippets.

@preaction
Created December 27, 2010 06:29
Show Gist options
  • Select an option

  • Save preaction/755915 to your computer and use it in GitHub Desktop.

Select an option

Save preaction/755915 to your computer and use it in GitHub Desktop.
// Build inner walls
var walls:Array = WALLS_BY_LEVEL[ number ];
for ( var i:int = 0; i < walls.length; i++ ) {
var wall:Object = walls[i];
add( new Wall( wall.x, wall.y, wall.width, wall.height, wall.tile ) );
}
// Build pies
for ( var i:int = 0; i < 50; i++ ) {
var pie:Pie = new Pie();
pie.x = Math.random() * ( max_x - min_x ) + min_x;
pie.y = Math.random() * ( max_y - min_y ) + min_y;
add( pie );
var wall:Entity = pie.collide( "wall", pie.x, pie.y );
while ( wall ) {
trace(" PIE COLLIDED! ");
pie.x = Math.random() * ( max_x - min_x ) + min_x;
pie.y = Math.random() * ( max_y - min_y ) + min_y;
wall = pie.collide( "wall", pie.x, pie.y );
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment