public ControlScheme() { this.Up = ControlScheme.keyboardOrGamepadAction(Key.Up, Key.W, "-y"); this.Down = ControlScheme.keyboardOrGamepadAction(Key.Down, Key.S, "+y"); this.Left = ControlScheme.keyboardOrGamepadAction(Key.Left, Key.A, "-x"); this.Right = ControlScheme.keyboardOrGamepadAction(Key.Right, Key.D, "+x"); this.Action = ControlScheme.keyboardOrGamepadAction(Key.Space, "a"); }
public Wisp(GameState game, Vector2 position) : base(game, position, Settings.Game.Wisp.FrictionCoefficient) { this.controls = new ControlScheme(); this.health = Settings.Game.Wisp.MaxHealth; this.healStartTime = -1000; this.particles = new ParticleCloud(game, 50, this, Color.LightYellow.WithAlpha(0.5f) * GlobalRandom.NextFloat(0.03f, 0.1f), 10, 0.6f); }
private static IAction keyboardOrGamepadAction(Key key, Key key2, string gamepadControl) { return(ControlScheme.keyboardOrGamepadAction(key, gamepadControl) .Or(KeyboardKeyAction.FromKey(key2))); }