Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package ;
- import nme.display.Sprite;
- import nme.display.Graphics;
- import nme.events.Event;
- import nme.events.MouseEvent;
- import nme.events.KeyboardEvent;
- import nme.display.Stage;
- import nme.Lib;
- import nape.geom.Vec2;
- import nape.phys.Body;
- import nape.shape.Circle;
- import nape.shape.Polygon;
- import nape.space.Space;
- import nape.util.Debug;
- class Game {
- public var debug:Debug;
- public var space:Space;
- public var STATE_ROTATE:String;
- public var STATE_MOVE:String;
- public var STATE_ACTION:String;
- public var playerVecX:Float;
- public var playerVecY:Float;
- public var player:Player;
- public var weapons:Weapons;
- public var bullet:Bullet;
- public function new(){
- }
- public function init():Void
- {
- space = new Space(new Vec2(0,0));
- debug = new ShapeDebug(Lib.current.stage.stageWidth, Lib.current.stage.stageHeight, 0x333333);
- Lib.current.stage.addChild(debug.display);
- Lib.current.stage.addEventListener(Event.ENTER_FRAME, update);
- Lib.current.stage.addEventListener(MouseEvent.CLICK, onClick);
- Lib.current.stage.addEventListener(KeyboardEvent.KEY_DOWN, onKeyDown);
- Lib.current.stage.addEventListener(KeyboardEvent.KEY_UP, onKeyUp);
- trace("first init");
- new PlayerClass();
- new World().createWorld(space);
- player = new Player(Lib.current.stage);
- player.space = space;
- weapons = new Weapons();
- }
Add Comment
Please, Sign In to add comment