コード例 #1
0
        public PlayerControls()
        {
            this.rotateClockwise        = KeyboardAction.FromKey(Key.Right);
            this.rotateCounterClockwise = KeyboardAction.FromKey(Key.Left);
            this.shoot   = KeyboardAction.FromKey(Key.Space);
            this.zoomIn  = KeyboardAction.FromKey(Key.PageDown);
            this.zoomOut = KeyboardAction.FromKey(Key.PageUp);

            this.shootDebug = KeyboardAction.FromKey(Key.P);
        }
コード例 #2
0
ファイル: EconomyController.cs プロジェクト: tdav/syzygy
        public EconomyController(GameState game, Id <Player> player, PlayerGameView view)
            : base(game)
        {
            this.view    = view;
            this.player  = game.Players[player];
            this.economy = game.Economies.First(e => e.Player == this.player);
            this.body    = this.economy.Body;

            view.FocusOnBody(this.body);

            this.controls = new PlayerControls();

            this.stats = new[]
            {
                new EcoStatController(this.game, this, this.economy, EcoValue.Income,
                                      KeyboardAction.FromKey(Key.Number1), KeyboardAction.FromKey(Key.Number2), "1<>2"),
                new EcoStatController(this.game, this, this.economy, EcoValue.Projectiles,
                                      KeyboardAction.FromKey(Key.Q), KeyboardAction.FromKey(Key.W), "Q<>W"),
                new EcoStatController(this.game, this, this.economy, EcoValue.FireRate,
                                      KeyboardAction.FromKey(Key.A), KeyboardAction.FromKey(Key.S), "A<>S"),
                new EcoStatController(this.game, this, this.economy, EcoValue.Defenses,
                                      KeyboardAction.FromKey(Key.Z), KeyboardAction.FromKey(Key.X), "Z<>X"),
            };
        }