public override void Initialize() { base.Initialize(); input = new PlayerInput(PlayerIndex.One); input.BindAction("Exit", Keys.Z); input.BindAction("Enter", Keys.X); screens = new Dictionary<string, Screen> { //{"scripting", new ScriptTest()} //{"player", new PlayerTest()}, //{"particles", new ParticlesTest()} //{"xmltest", new XMLTest()} {"gametest", new GameTest()} }; foreach (var screen in screens.Values) Add(screen); }
public override void Initialize() { // Must happen at the start base.Initialize(); //CollisionEngine.Debug = true; CollisionEngine.Register<Enemy, PlayerBullet>(GetHitByABullet); CollisionEngine.Register<Player, EnemyBullet>(GetHitByABullet); CollisionEngine.Register<Player, Enemy>(GetHitByASprite); AnimationLoader.Test(); player = new Player(); Add(player); input = new PlayerInput(PlayerIndex.One); input.BindAction("Quit", Keys.Q); input.BindAction("Left", Keys.Left); input.BindAction("Right",Keys.Right); input.BindAction("Up",Keys.Up); input.BindAction("Down",Keys.Down); input.BindAction("Fire",Keys.Space); fireLimit = new Limiter(.05f); CollisionEngine.Add(player); ScriptingEngine.Add("player", player); var enemies = new DrawableGameObject(); Add(enemies); ScriptingEngine.Add("enemies", enemies); ScriptingEngine.Load("GameTest"); }
/// <summary> /// Allows the screen to handle user input. Unlike Update, this method /// is only called when the screen is active, and not when some other /// screen has taken the focus. /// </summary> public virtual void HandleInput(PlayerInput input) { }