Beispiel #1
0
        private void OnKeyReleased(Object sender, KeyEventArgs e = null)
        {
            if (!BeenReleasedSinceOpen)
            {
                BeenReleasedSinceOpen = true;
                return;
            }

            if (e != null && Game.KeyIsNotAllowed(e.Code))
            {
                return;
            }

            if (Tutorial == null || Tutorial.Finished)
            {
                if (Parent != null)
                {
                    Parent.RemoveChild(this);
                }
            }
            else
            {
                Tutorial.NextFrame();
            }
        }
Beispiel #2
0
        private void OnKeyPressed(Object sender, KeyEventArgs e = null)
        {
            if (e != null && Game.KeyIsNotAllowed(e.Code))
            {
                return;
            }

            HoldButtonTimer.Start();
        }
        private void OnKeyReleased(Object sender, KeyEventArgs e = null)
        {
            if (e != null && Game.KeyIsNotAllowed(e.Code))
            {
                return;
            }

            Parent.RemoveChild(this);
            Game.Reset();
        }
Beispiel #4
0
        private void OnKeyReleased(Object sender, KeyEventArgs e = null)
        {
            if (e != null && Game.KeyIsNotAllowed(e.Code))
            {
                return;
            }

            HoldButtonTimer.Stop();

            SelectButton(CurrentSelection == ButtonNames.Count - 1 ? 0 : CurrentSelection + 1);
        }
Beispiel #5
0
        protected override void OnKeyReleased(object sender, KeyEventArgs e)
        {
            if (IsDead() || !KeyDown || (e != null && Game.KeyIsNotAllowed(e.Code)))
            {
                return;
            }

            KeyDown = false;

            if (!Game.IsRunning())
            {
                // Interrupt aiming if the player releases the key while paused
                if (!CanRotate)
                {
                    AimAssistance.AimEnd();
                    foreach (AimAssistance a in AimAssistanceExtras)
                    {
                        a.AimEnd();
                    }
                }
                return;
            }

            if (CanRotate)
            {
                return;
            }

            Weapon.Fire(Utils.GetPointInDirection(Position, Rotation, 40), Rotation, Utils.GetPointInDirection(Position, Rotation, AimAssistance.Reticle.Y));
            foreach (AimAssistance a in AimAssistanceExtras)
            {
                Weapon.Fire(Utils.GetPointInDirection(Position, Rotation + a.RotationOffset, 40), Rotation + a.RotationOffset, Utils.GetPointInDirection(Position, Rotation + a.RotationOffset, a.Reticle.Y));
            }

            StartRotationDelay();

            AimAssistance.AimEnd();
            foreach (AimAssistance a in AimAssistanceExtras)
            {
                a.AimEnd();
            }
        }
Beispiel #6
0
        protected override void OnKeyPressed(object sender, KeyEventArgs e)
        {
            if (KeyDown || IsDead() || (e != null && Game.KeyIsNotAllowed(e.Code)))
            {
                return;
            }

            KeyDown = true;

            if (!Game.IsRunning())
            {
                return;
            }

            CanRotate = false;
            RotationDelayTimer.Stop();

            AimAssistance.AimStart();
            foreach (AimAssistance t in AimAssistanceExtras)
            {
                t.AimStart();
            }
        }