Guest User

Untitled

a guest
Sep 12th, 2018
213
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. package;
  2.  
  3. import nme.Lib;
  4. import org.flixel.FlxGame;
  5. import states.MenuState;
  6.  
  7. class MyGame extends FlxGame
  8. {
  9.    
  10.     #if flash
  11.     public static var SoundExtension:String = ".mp3";
  12.     #elseif neko
  13.     public static var SoundExtension:String = ".ogg";
  14.     #else
  15.     public static var SoundExtension:String = ".wav";
  16.     #end
  17.    
  18.     #if !neko
  19.     public static var SoundOn:Bool = true;
  20.     #else
  21.     public static var SoundOn:Bool = true;
  22.     #end
  23.    
  24.     public function new()
  25.     {
  26.         var stageWidth:Int = Lib.current.stage.stageWidth;
  27.         var stageHeight:Int = Lib.current.stage.stageHeight;
  28.        
  29.         var ratioX:Float = stageWidth / 640;
  30.         var ratioY:Float = stageHeight / 480;
  31.         var ratio:Float = Math.min(ratioX, ratioY);
  32.         #if (flash || desktop || neko)
  33.         super(Math.floor(stageWidth / ratio), Math.floor(stageHeight / ratio), MenuState, ratio, 60, 60, true);
  34.         #else
  35.         super(Math.floor(stageWidth / ratio), Math.floor(stageHeight / ratio), MenuState, ratio, 60, 30, true);
  36.         #end
  37.  
  38.         forceDebugger = true;
  39.         useSystemCursor = true;
  40.         mouseEnabled = true;
  41.         _mouse.visible = true;
  42.     }
  43. }
Add Comment
Please, Sign In to add comment