Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package {
- import flash.display.Sprite;
- public class TileHolder extends Sprite{
- var gridSize:int = 50;
- var tiles:Array = [];
- public function TileHolder() {
- // constructor code
- generateTileGrid();
- trace(tiles.length)
- //trace(tiles[1][1])
- trace(getTileData(1,1))
- }
- function generateTileGrid(){
- for(var i:int = gridSize;i>0;i--){
- tiles.push(generateTileLine)
- }
- }
- function generateTileLine(){
- var a:Array = new Array();
- for(var i:int = gridSize;i>0;i--){
- a.push("1")
- }
- return a
- }
- function getTileData(X,Y){
- var tileData = tiles[Y][X]
- return tileData
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement