Advertisement
Guest User

Untitled

a guest
Jun 27th, 2017
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. //original function
  2.  
  3. public function initiate(parent:DisplayObjectContainer, tileSize:int, tilesX:int, tilesY:int, screenWidth:int, screenHeight:int, backgroundColor:uint, active:Boolean= true):void {
  4.             if (_initiated) return;
  5.             _initiated = true;
  6.            
  7.             //tile size and world size
  8.             _tileSize = tileSize;
  9.             _tilesX = tilesX;
  10.             _tilesY = tilesY;
  11.             _boundingWidth = _tileSize * _tilesX;
  12.             _boundingHeight = _tileSize * _tilesY;
  13.            
  14.             //store screen size
  15.             _screenWidth = Math.min(screenWidth, _boundingWidth);
  16.             _screenHeight = Math.min(screenHeight, _boundingHeight);
  17.            
  18.             this.backgroundColor = backgroundColor;
  19.            
  20.            
  21.             for (var i:int = 0; i < _tilesX * _tilesY; i++) {
  22.                 _tiles.push(null);
  23.                 _tileObjects.push(new Array());
  24.             }
  25.             _parent = parent;
  26.             if (active) activate();
  27.         }
  28.  
  29.  
  30.  
  31. // The overridden function
  32. override public function initiate(parent:DisplayObjectContainer, tileSize:int=40, tilesX:int=20, tilesY:int=15, screenWidth:int=800, screenHeight:int=600, backgroundColor:uint=0x000000, active:Boolean = true):void
  33.         {
  34.             super.initiate(parent, tileSize, tilesX, tilesY, screenWidth, screenHeight, backgroundColor, active);
  35.         }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement