62 lines
		
	
	
		
			1.5 KiB
		
	
	
	
		
			Haxe
		
	
	
	
	
	
			
		
		
	
	
			62 lines
		
	
	
		
			1.5 KiB
		
	
	
	
		
			Haxe
		
	
	
	
	
	
| package game;
 | |
| 
 | |
| import openfl.display.Stage;
 | |
| import openfl.display.Sprite;
 | |
| import openfl.events.Event;
 | |
| 
 | |
| import engine.HProfiler;
 | |
| import engine.ConVar;
 | |
| import engine.ui.UIPane;
 | |
| import engine.typedefs.console.CVar;
 | |
| import engine.tools.ui.UITool;
 | |
| 
 | |
| import game.ui.console.ConsolePane;
 | |
| import game.entities.Player;
 | |
| import game.ui.console.Console;
 | |
| 
 | |
| 
 | |
| import assets.HTex;
 | |
| import assets.Scanner;
 | |
| 
 | |
| class Game
 | |
| {
 | |
|     public var stage:Stage;
 | |
|     public var gameLayer:Sprite;
 | |
|     public var uiLayer:Sprite;
 | |
|     public function new(_stage:Stage){
 | |
|         stage = _stage;
 | |
| #if PRECACHE_ASSETS & sys
 | |
|         Scanner.scanTextureDir();
 | |
|         for(tex in Scanner.textures){
 | |
|             HTex.createTextureObjectFromJSON(tex);
 | |
|         }
 | |
| #end
 | |
|         gameLayer = new Sprite();
 | |
|         uiLayer = new Sprite();
 | |
|         trace("wattafak");
 | |
|     }
 | |
|     public var player:Player;
 | |
|     public var console:Console = new Console();
 | |
|     public function loadData():Void
 | |
|     {
 | |
|         new game.ui.text.TextFormats();
 | |
|     }
 | |
|     public function onInit():Void
 | |
|     {
 | |
|         gameLayer = new Sprite();
 | |
|         uiLayer = new Sprite();
 | |
|         stage.addChild(gameLayer);
 | |
|         stage.addChild(uiLayer);
 | |
|         var console2:ConsolePane = new ConsolePane();
 | |
|         uiLayer.addChild(console2);
 | |
|         uiLayer.addChild(console);
 | |
|         HProfiler.startProfiling("frametime");
 | |
|         //UITool.spawnUIEditorWindow();
 | |
| 	}
 | |
| 	public function onEnterFrame(e:Event):Void
 | |
| 	{
 | |
|         HProfiler.stopProfiling("frametime");
 | |
|         HProfiler.startProfiling("frametime");
 | |
|         Input.onEnterFrame();
 | |
| 	}
 | |
| } |