changed a bunch of fucking shit
This commit is contained in:
@@ -1,33 +1,33 @@
|
||||
import game.video.Mode;
|
||||
import openfl.events.KeyboardEvent;
|
||||
import openfl.display.Sprite;
|
||||
import openfl.display.Stage;
|
||||
import openfl.events.Event;
|
||||
import game.Input;
|
||||
import game.Game;
|
||||
import game.video.Mode;
|
||||
|
||||
class Main extends Sprite {
|
||||
public function new () {
|
||||
super ();
|
||||
this.addEventListener(Event.ADDED_TO_STAGE, onInit);
|
||||
//stage.application.window.resize(1920, 1080);
|
||||
//stage.application.window.title = "Kanker";
|
||||
}
|
||||
private function onInit(e:Event)
|
||||
{
|
||||
stage.frameRate = 1000;
|
||||
var game:Game = new Game(stage);
|
||||
game.onInit();
|
||||
stage.addEventListener(Event.ENTER_FRAME, game.onEnterFrame);
|
||||
stage.addEventListener(KeyboardEvent.KEY_DOWN,keyIsDown);
|
||||
stage.addEventListener(KeyboardEvent.KEY_UP,keyIsUp);
|
||||
stage.addEventListener(KeyboardEvent.KEY_DOWN,Input.onKeyIsDown);
|
||||
stage.addEventListener(KeyboardEvent.KEY_UP,Input.onKeyIsUp);
|
||||
stage.addEventListener(Event.RESIZE,onResize);
|
||||
stage.application.window.resize(1920, 1080);
|
||||
stage.application.window.title = "Kanker";
|
||||
|
||||
}
|
||||
game.onInit();
|
||||
Mode.setVideoMode(1920, 1080);
|
||||
}
|
||||
private function onResize (event:Event):Void {
|
||||
//Here we can do shit with window scaling
|
||||
//stage.stageWidth;
|
||||
//stage.stageHeight;
|
||||
}
|
||||
|
||||
private function keyIsDown(e:KeyboardEvent){
|
||||
Game.keys[e.keyCode] = true;
|
||||
}
|
||||
private function keyIsUp(e:KeyboardEvent){
|
||||
Game.keys[e.keyCode] = false;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user