예제 #1
0
        private static void SecondPlayerBallControls(GameTime gameTime)
        {
            if (SecondPlayer.Instance.InputManagerInstance.KeyDown(Keys.RightControl))
            {
                ballSecond.BallFired = true;
                secondBallTimer.Start();

                if (!ballSecond.BallInitialised)
                {
                    ballSecond.CannonEffect.Play();
                    ballSecond.FireFlashCounter = 0;
                    ballSecond.Initialise(ballSecond.BallFiredPos = new Vector2(SecondPlayer.Instance.Ship.Position.X - SecondPlayer.Instance.ShipImage.Texture.Width / 2f, SecondPlayer.Instance.Ship.Position.Y + (SecondPlayer.Instance.ShipImage.Texture.Height / 2f)), SecondPlayer.Instance.PlayerType);
                    ballSecond.BallInitialised = true;
                }
            }

            if (ballSecond.BallFired)
            {
                ballSecond.UpdateSecond(gameTime);
            }
        }
예제 #2
0
        private static void FirstPlayerBallControls(GameTime gameTime)
        {
            if (FirstPlayer.Instance.InputManagerInstance.KeyDown(Keys.LeftControl))
            {
                ballFirst.BallFired = true;
                firstBallTimer.Start();

                if (!ballFirst.BallInitialised)
                {
                    ballFirst.CannonEffect.Play();
                    ballFirst.FireFlashCounter = 0;
                    ballFirst.Initialise(ballFirst.BallFiredPos = new Vector2(FirstPlayer.Instance.Ship.Position.X + FirstPlayer.Instance.ShipImage.Texture.Width, FirstPlayer.Instance.Ship.Position.Y + (FirstPlayer.Instance.ShipImage.Texture.Height / 2f)), FirstPlayer.Instance.PlayerType);
                    ballFirst.BallInitialised = true;
                }
            }

            if (ballFirst.BallFired)
            {
                ballFirst.UpdateFirst(gameTime);
            }
        }