import haxe.Timer;

class Main {
  static public var _this:Main;
  private var _timer:Timer;
  public var wm:Watermelon;

  static function main() {
    _this = new Main();
  }

  private function new() {
    _timer = new Timer( 40 );
    _timer.run = isReady;
  }

  private function isReady():Void {
    if ( flash.Lib.current.stage != null ) {
      if ( Std.is( flash.Lib.current.stage.stageWidth, Int ) &&
           Std.is( flash.Lib.current.stage.stageHeight, Int ) ) {
        trace( "stagewidth verified" );
        _timer.stop();
        wm = new Watermelon();
      }
    }
  }
}
