changed a bunch of fucking shit
This commit is contained in:
@@ -1,5 +1,7 @@
|
||||
package game;
|
||||
|
||||
import openfl.display.DisplayObject;
|
||||
import game.ui.Console;
|
||||
import game.entities.Player;
|
||||
import assets.tilesets.TilesetGeneric;
|
||||
import assets.tilesets.Tileset;
|
||||
@@ -11,30 +13,48 @@ import openfl.display.Sprite;
|
||||
import openfl.ui.Keyboard;
|
||||
import openfl.events.Event;
|
||||
import openfl.Assets;
|
||||
import openfl.display.DisplayObject;
|
||||
import assets.Scanner;
|
||||
import assets.HTex;
|
||||
import openfl.Lib;
|
||||
import openfl.display.StageDisplayState;
|
||||
import game.ui.ConVar;
|
||||
|
||||
class Game
|
||||
{
|
||||
public var stage:Stage;
|
||||
public var gameLayer:Sprite;
|
||||
public var uiLayer:Sprite;
|
||||
public function new(_stage:Stage){
|
||||
stage = _stage;
|
||||
Scanner.scanTextureDir();
|
||||
for(tex in Scanner.textures){
|
||||
HTex.createTextureObjectFromJSON(tex);
|
||||
}
|
||||
|
||||
gameLayer = new Sprite();
|
||||
uiLayer = new Sprite();
|
||||
|
||||
|
||||
trace("wattafak");
|
||||
}
|
||||
public var player:Player;
|
||||
public var console:Console = new game.ui.Console();
|
||||
public function onInit():Void
|
||||
{
|
||||
|
||||
gameLayer = new Sprite();
|
||||
uiLayer = new Sprite();
|
||||
stage.addChild(gameLayer);
|
||||
stage.addChild(uiLayer);
|
||||
//player.graphics.lineStyle(2,0xFF0000);
|
||||
//player.graphics.drawRect(0,0,16,16);
|
||||
// var bitmapData:BitmapData = Assets.getBitmapData("textures/sprites/character.png");
|
||||
player = new Player();
|
||||
stage.addChild(player.sprite);
|
||||
console = new Console();
|
||||
gameLayer.addChild(player.sprite);
|
||||
uiLayer.addChild(console);
|
||||
Console.consoleIndex.devMsg("kankerjood");
|
||||
ConVar.setCVar("echo", "blaw");
|
||||
//var sheet:SpriteSheet = new SpriteSheet(sheetData);
|
||||
//var playerBitmap:Bitmap = new Bitmap(Tileset.tilesetMap["testsheet"].tileMap["testTile5"]);
|
||||
//var someotherbitmap:Bitmap = new Bitmap(Tileset.tilesetMap["testsheet"].tileMap["testTile3"]);
|
||||
@@ -43,20 +63,10 @@ class Game
|
||||
//TextureData.parseConfig();
|
||||
//Sys.
|
||||
}
|
||||
public static var keys:Array<Bool> = [];
|
||||
public static var keysLast:Array<Bool> = [];
|
||||
public function onEnterFrame(e:Event):Void
|
||||
{
|
||||
trace(keys);
|
||||
if( keys[Keyboard.ALTERNATE] && keys[Keyboard.ENTER] && !keysLast[Keyboard.ALTERNATE] && !keysLast[Keyboard.ENTER] ){
|
||||
if(Lib.current.stage.displayState != StageDisplayState.FULL_SCREEN_INTERACTIVE){
|
||||
Lib.current.stage.displayState = StageDisplayState.FULL_SCREEN_INTERACTIVE;
|
||||
}
|
||||
else{
|
||||
Lib.current.stage.displayState = StageDisplayState.NORMAL;
|
||||
}
|
||||
}
|
||||
keysLast = keys;
|
||||
Input.onEnterFrame();
|
||||
|
||||
//player.x++;
|
||||
//player.y++;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user