protected VirtualAxis(string name)
 {
     Name        = name;
     RepeaterPos = new InputRepeater(() => Value > GlobalInputProperties.AxisDeadzone);
     RepeaterNeg = new InputRepeater(() => Value < -GlobalInputProperties.AxisDeadzone);
     InputManager.InputUpdate += Update;
     InputManager.InputUpdate += RepeaterPos.Update;
     InputManager.InputUpdate += RepeaterNeg.Update;
 }
Exemplo n.º 2
0
    public GameRunner(BlockMover mover, ScoreboardFactory scoreboardFactory, AudioPlayer audio)
    {
        this.scoreboardFactory = scoreboardFactory;
        this.mover             = mover;
        this.audio             = audio;

        leftShifter  = new InputRepeater(0.25, 0.02, mover.MoveLeft);
        rightShifter = new InputRepeater(0.25, 0.02, mover.MoveRight);
        spinShifter  = new InputRepeater(0.5, 0.1, mover.RotateAntiClockwise);
    }