document.write('
Data hosted with ♥ by Pastebin.com - Download Raw - See Original
  1. static function main ()
  2.     {
  3.         var b = new Bitmap (new BitmapData (512, 512, false, 0x0));
  4.         b.y = 30;
  5.         Lib.current.addChild (b);
  6.         for (i in 0...50000)
  7.         {
  8.             var e = new Entity ();
  9.             e.addComponent (CPosition(256,20));
  10.             e.addComponent (CVelocity(
  11.                 Math.cos (i) * Math.random()*8+1,
  12.                 Math.sin (i) * Math.random()*8+1
  13.             ));
  14.             if (Math.random() > .5)
  15.             {
  16.                 e.addComponent (CColor(
  17.                     (Std.int (Math.random () * 0xFFFFFF)) | 0xFF000000
  18.                 ));
  19.             }
  20.         }
  21.         //register (Class<System>(ctor), interrupt)
  22.         System.register (SBounceSystem, 8);
  23.         System.register (SGravitySystem, 8);
  24.         System.register (SPhysicsSystem, 8);
  25.         System.register (SRenderSystem(b.bitmapData), 16);
  26.     }
');