Advertisement
KaeruCT

double

Feb 16th, 2012
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. // useless, but i want to keep it somewhere in case i need it later
  2.  
  3. // doubles the size of the map, so it doesn't feel so tight
  4.         private function doubleSize():void {
  5.             var newMap:Array = [];
  6.            
  7.             for (var i:int = 0; i < this.map.length; i++ ) {
  8.                
  9.                 newMap[2*i-1] = [];
  10.                 newMap[2*i] = [];
  11.                
  12.                 for (var k:int = 0; k < this.map[i].length; k++ ) {
  13.                     newMap[2*i-1][2*k-1] = this.map[i][k];
  14.                     newMap[2*i-1][2*k] = this.map[i][k];
  15.                     newMap[2*i][2*k-1] = this.map[i][k];
  16.                     newMap[2*i][2*k] = this.map[i][k];
  17.                 }
  18.             }
  19.            
  20.             this.map = newMap;
  21.         }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement