Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //original function
- public function initiate(parent:DisplayObjectContainer, tileSize:int, tilesX:int, tilesY:int, screenWidth:int, screenHeight:int, backgroundColor:uint, active:Boolean= true):void {
- if (_initiated) return;
- _initiated = true;
- //tile size and world size
- _tileSize = tileSize;
- _tilesX = tilesX;
- _tilesY = tilesY;
- _boundingWidth = _tileSize * _tilesX;
- _boundingHeight = _tileSize * _tilesY;
- //store screen size
- _screenWidth = Math.min(screenWidth, _boundingWidth);
- _screenHeight = Math.min(screenHeight, _boundingHeight);
- this.backgroundColor = backgroundColor;
- for (var i:int = 0; i < _tilesX * _tilesY; i++) {
- _tiles.push(null);
- _tileObjects.push(new Array());
- }
- _parent = parent;
- if (active) activate();
- }
- // The overridden function
- 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
- {
- super.initiate(parent, tileSize, tilesX, tilesY, screenWidth, screenHeight, backgroundColor, active);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement