private int GetInput() { var input = InputUtil.GetY(); if (input != 0) { if (keyInputRepeatTimer.IsTimeout()) { keyInputRepeatTimer.Start(); return(input); } else { return(0); } } else { keyInputRepeatTimer.Reset(); return(input); } }
// Update is called once per frame protected override void Update() { base.Update(); if (GameProvider.IsGameOver) { return; } var dx = InputUtil.GetX(); var dy = InputUtil.GetY(); Move(dx, dy); CenterPlayer(); if (InputUtil.GetButton(0)) { TryAttack(); } else { if (IsHaijin) { CurrentBurst = null; } } if (InputUtil.GetButtonDown(1)) { TryCreateLink(); } if (CurrentPortal != null) { TryCaptureOrRecharge(CurrentPortal, Achievement); } }