Advertisement
Guest User

Untitled

a guest
Jun 27th, 2017
50
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. /**
  2.  * ...
  3.  * @author S*****************************
  4.  */
  5.  
  6.  
  7. package;
  8. import flash.display.Sprite;
  9. import flash.display.Shape;
  10. import flash.Lib;
  11.  
  12. class Main extends Sprite
  13. {
  14.     static function main()
  15.     {
  16.         Lib.current.addChild(new Main());
  17.     }  
  18.     public function new()
  19.     {
  20.         super();
  21.         arrayHandler();
  22.     }
  23.     public function arrayHandler()
  24.     {
  25.         var array:Array<Array<Map>> = new Array<Array<Map>>();
  26.        
  27.         for (i in 0...10)
  28.         {
  29.             for (j in 0...10)
  30.             {
  31.                 var m = new Map(20*j, 20*i);
  32.                 Lib.current.addChild(m);
  33.             }
  34.         }
  35.     }
  36. }
  37. class Map extends Sprite
  38. {
  39.     public function new(xx:Int, yy:Int)
  40.     {
  41.         super();
  42.         graphics.beginFill(0);
  43.         graphics.drawRect(0, 0, 20, 20);
  44.         graphics.beginFill(0xFF0000);
  45.         graphics.drawRect(1, 1, 18, 18);
  46.        
  47.         this.x = xx;
  48.         this.y = yy;
  49.     }
  50. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement