Ejemplo n.º 1
0
 public bool CircleCollides(clsSprite otherSprite)
 {
     //check if two circles sprite collided
     if (Vector2.Distance(this.center, otherSprite.center) <= this.radius + otherSprite.radius)
     {
         //this.position = new Vector2(otherSprite.position.X + (2 * otherSprite.radius), otherSprite.position.Y + (2 * otherSprite.radius));
     }
     return(Vector2.Distance(this.center, otherSprite.center) < this.radius + otherSprite.radius);
 }
Ejemplo n.º 2
0
        public bool Collides(clsSprite otherSprite)
        {
            //check if two sprites intersect
            bool collide = this.position.X + this.size.X >= otherSprite.position.X &&
                           this.position.X <= otherSprite.position.X + otherSprite.size.X &&
                           this.position.Y + this.size.Y >= otherSprite.position.Y &&
                           this.position.Y <= otherSprite.position.Y + otherSprite.size.Y;

            return(collide);
        }
Ejemplo n.º 3
0
 public bool CircleCollidesPaddle(clsSprite otherSprite)
 {
     //Taken from provided vanilla pong code from https://github.com/KatherineG/InworksGameDev
     if ((this.position.X + this.size.X >= otherSprite.position.X) &&    // right side
         (this.position.Y + this.size.Y >= otherSprite.position.Y) &&    //top boundary
         (this.position.Y < otherSprite.position.Y + otherSprite.size.Y) &&
         this.position.X <= otherSprite.position.X + otherSprite.size.X) //bottom boundary
     {
         return(true);
     }
     else
     {
         return(false);
     }
 }
Ejemplo n.º 4
0
        public clsPlayer(Texture2D texture, PongGame.PlayerType typeOfPlayer, Vector2 position, Vector2 newSize, Vector2 screenSize)
        {
            score      = 0;
            playerType = typeOfPlayer;
            switch (playerType)
            {
            case PongGame.PlayerType.PlayerOne:
                //position associated with right side
                paddle = new clsSprite(texture, position, newSize, (int)screenSize.X, (int)screenSize.Y);
                break;

            case PongGame.PlayerType.PlayerTwo:
                paddle = new clsSprite(texture, position, newSize, (int)screenSize.X, (int)screenSize.Y);
                break;

            case PongGame.PlayerType.CPU:
                paddle = new clsSprite(texture, position, newSize, (int)screenSize.X, (int)screenSize.Y);
                break;
            }
        }
Ejemplo n.º 5
0
        /// <summary>
        /// Initializes Games based off of Game Type
        /// </summary>
        /// <param name="playerOneTexture">Player One Paddle</param>
        /// <param name="playerTwoTexture">Player Two Paddle</param>
        /// <param name="barrierTexture">Barrier Paddle</param>
        /// <param name="gameBallTexture">Gameball</param>
        /// <param name="ballSpeedUpTexure">PowerUp_BallSpeedInc</param>
        /// <param name="ballSpeedDownTexture">PowerUp_BallSpeedDec</param>
        /// <param name="barrierSpeedUpTexture">PowerUp_BarrierSpeedInc</param>
        /// <param name="barrierSpeedDownTexture">PowerUp_BarrierSpeedDec</param>
        /// <param name="graphics">Used for getting screen width and height</param>
        /// <param name="numOfUsers">Determines game type</param>
        public PongGame(Texture2D playerOneTexture, Texture2D playerTwoTexture, Texture2D barrierTexture,
                        Texture2D gameBallTexture, Texture2D ballSpeedUpTexture, Texture2D ballSpeedDownTexture,
                        Texture2D barrierSpeedUpTexture, Texture2D barrierSpeedDownTexture, GraphicsDeviceManager graphics, int numOfUsers)
        {
            // Sound Effects Initialization
            #region Sound Effects
            audioEngine = new AudioEngine("Content\\Lab4Sounds.xgs");
            ballHit     = new WaveBank(audioEngine, "Content\\Sounds.xwb");
            score       = new WaveBank(audioEngine, "Content\\Sounds.xwb");
            soundsBank  = new SoundBank(audioEngine, "Content\\SoundsBank.xsb");
            ballCue     = soundsBank.GetCue("BallHit");
            scoreCue    = soundsBank.GetCue("Score");

            #endregion
            gameActive   = true;
            winningScore = 5;
            #region Single Player
            if (numOfUsers == 1)
            {
                #region Paddles
                P1 = new clsPlayer(playerOneTexture, PlayerType.PlayerOne, new Vector2(graphics.PreferredBackBufferWidth - 51, (graphics.PreferredBackBufferHeight / 2) - 75), new Vector2(51, 235), new Vector2(graphics.PreferredBackBufferWidth, graphics.PreferredBackBufferHeight));
                P2 = new clsPlayer(playerTwoTexture, PlayerType.CPU, new Vector2(0, (graphics.PreferredBackBufferHeight / 2) - 75), new Vector2(51, 235), new Vector2(graphics.PreferredBackBufferWidth, graphics.PreferredBackBufferHeight));
                P1.paddle.velocity = new Vector2(0, 0);
                P2.paddle.velocity = new Vector2(0, -5);
                #endregion
                #region Barriers
                if (Game1.gameSettings.barriers == true)
                {
                    topBarrier          = new clsSprite(barrierTexture, new Vector2((graphics.PreferredBackBufferWidth / 2) - 25.5f, 0), new Vector2(51, 167), graphics.PreferredBackBufferWidth, graphics.PreferredBackBufferHeight);
                    topBarrier.velocity = new Vector2(0f, 5f);
                    botBarrier          = new clsSprite(barrierTexture, new Vector2((graphics.PreferredBackBufferWidth / 2) - 25.5f, graphics.PreferredBackBufferHeight - 167), new Vector2(51, 167), graphics.PreferredBackBufferWidth, graphics.PreferredBackBufferHeight);
                    botBarrier.velocity = new Vector2(0f, -5f);
                }
                #endregion
                #region Game Ball
                gameBall          = new clsSprite(gameBallTexture, new Vector2((graphics.PreferredBackBufferWidth / 2) - 18, (graphics.PreferredBackBufferHeight / 2) - 18), new Vector2(36, 36), graphics.PreferredBackBufferWidth, graphics.PreferredBackBufferHeight);
                gameBall.velocity = new Vector2(randPowerUp.Next(5, 7), randPowerUp.Next(-2, 3));
                if (gameBall.velocity.Y == 0)
                {
                    gameBall.velocity = new Vector2(gameBall.velocity.X, randPowerUp.Next(-3, -1));
                }
                #endregion
                #region PowerUps
                if (Game1.gameSettings.powerUps == true)
                {
                    ballSpeedUp      = new clsPowerUp(ballSpeedUpTexture, new Vector2(graphics.PreferredBackBufferWidth + 200, graphics.PreferredBackBufferHeight + 200), new Vector2(36, 36), graphics.PreferredBackBufferWidth, graphics.PreferredBackBufferHeight, clsPowerUp.PowerUpType.BallSpeedUp);
                    ballSpeedDown    = new clsPowerUp(ballSpeedDownTexture, new Vector2(graphics.PreferredBackBufferWidth + 200, graphics.PreferredBackBufferHeight + 200), new Vector2(36, 36), graphics.PreferredBackBufferWidth, graphics.PreferredBackBufferHeight, clsPowerUp.PowerUpType.BallSpeedDown);
                    barrierSpeedUp   = new clsPowerUp(barrierSpeedUpTexture, new Vector2(graphics.PreferredBackBufferWidth + 200, graphics.PreferredBackBufferHeight + 200), new Vector2(87, 78), graphics.PreferredBackBufferWidth, graphics.PreferredBackBufferHeight, clsPowerUp.PowerUpType.BarrierSpeedUp);
                    barrierSpeedDown = new clsPowerUp(barrierSpeedDownTexture, new Vector2(graphics.PreferredBackBufferWidth + 200, graphics.PreferredBackBufferHeight + 200), new Vector2(72, 63), graphics.PreferredBackBufferWidth, graphics.PreferredBackBufferHeight, clsPowerUp.PowerUpType.BarrierSpeedDown);
                    if (Game1.gameSettings.barriers)
                    {
                        barrierSpeedDown.active = true;
                        barrierSpeedUp.active   = true;
                    }
                    ballSpeedUp.active   = true;
                    ballSpeedDown.active = true;
                }
                #endregion
            }
            #endregion
            #region Two Player
            else
            {
                #region Paddles
                P1 = new clsPlayer(playerOneTexture, PlayerType.PlayerOne, new Vector2(graphics.PreferredBackBufferWidth - 51, (graphics.PreferredBackBufferHeight / 2) - 75), new Vector2(51, 235), new Vector2(graphics.PreferredBackBufferWidth, graphics.PreferredBackBufferHeight));
                P2 = new clsPlayer(playerTwoTexture, PlayerType.PlayerTwo, new Vector2(0, (graphics.PreferredBackBufferHeight / 2) - 75), new Vector2(51, 235), new Vector2(graphics.PreferredBackBufferWidth, graphics.PreferredBackBufferHeight));
                P1.paddle.velocity = new Vector2(0, 0);
                P2.paddle.velocity = new Vector2(0, 0);
                #endregion
                #region Barriers
                if (Game1.gameSettings.barriers == true)
                {
                    topBarrier          = new clsSprite(barrierTexture, new Vector2((graphics.PreferredBackBufferWidth / 2) - 25.5f, 0), new Vector2(51, 167), graphics.PreferredBackBufferWidth, graphics.PreferredBackBufferHeight);
                    topBarrier.velocity = new Vector2(0f, 5f);
                    botBarrier          = new clsSprite(barrierTexture, new Vector2((graphics.PreferredBackBufferWidth / 2) - 25.5f, graphics.PreferredBackBufferHeight - 167), new Vector2(51, 167), graphics.PreferredBackBufferWidth, graphics.PreferredBackBufferHeight);
                    botBarrier.velocity = new Vector2(0f, -5f);
                }
                #endregion
                #region Game Ball
                gameBall          = new clsSprite(gameBallTexture, new Vector2((graphics.PreferredBackBufferWidth / 2) - 18, (graphics.PreferredBackBufferHeight / 2) - 18), new Vector2(36, 36), graphics.PreferredBackBufferWidth, graphics.PreferredBackBufferHeight);
                gameBall.velocity = new Vector2(randPowerUp.Next(5, 7), randPowerUp.Next(-2, 3));
                if (gameBall.velocity.Y == 0)
                {
                    gameBall.velocity = new Vector2(gameBall.velocity.X, randPowerUp.Next(-3, -1));
                }
                #endregion
                #region PowerUps
                if (Game1.gameSettings.powerUps == true)
                {
                    ballSpeedUp      = new clsPowerUp(ballSpeedUpTexture, new Vector2(graphics.PreferredBackBufferWidth + 200, graphics.PreferredBackBufferHeight + 200), new Vector2(36, 36), graphics.PreferredBackBufferWidth, graphics.PreferredBackBufferHeight, clsPowerUp.PowerUpType.BallSpeedUp);
                    ballSpeedDown    = new clsPowerUp(ballSpeedDownTexture, new Vector2(graphics.PreferredBackBufferWidth + 200, graphics.PreferredBackBufferHeight + 200), new Vector2(36, 36), graphics.PreferredBackBufferWidth, graphics.PreferredBackBufferHeight, clsPowerUp.PowerUpType.BallSpeedUp);
                    barrierSpeedUp   = new clsPowerUp(barrierSpeedUpTexture, new Vector2(graphics.PreferredBackBufferWidth + 200, graphics.PreferredBackBufferHeight + 200), new Vector2(87, 78), graphics.PreferredBackBufferWidth, graphics.PreferredBackBufferHeight, clsPowerUp.PowerUpType.BallSpeedUp);
                    barrierSpeedDown = new clsPowerUp(barrierSpeedDownTexture, new Vector2(graphics.PreferredBackBufferWidth + 200, graphics.PreferredBackBufferHeight + 200), new Vector2(72, 63), graphics.PreferredBackBufferWidth, graphics.PreferredBackBufferHeight, clsPowerUp.PowerUpType.BallSpeedUp);

                    if (Game1.gameSettings.barriers)
                    {
                        barrierSpeedDown.active = true;
                        barrierSpeedDown.active = true;
                    }
                    ballSpeedUp.active   = true;
                    ballSpeedDown.active = true;
                }
                #endregion
            }
            #endregion
        }
Ejemplo n.º 6
0
 public clsSprite slowBall(clsSprite ball)
 {
     ball.velocity /= 2;
     return(ball);
 }
Ejemplo n.º 7
0
 public clsSprite speedBall(clsSprite ball)
 {
     ball.velocity *= 2;
     return(ball);
 }
Ejemplo n.º 8
0
 public clsSprite slowBarrier(clsSprite barrier)
 {
     barrier.velocity /= 2;
     return(barrier);
 }
Ejemplo n.º 9
0
 public clsSprite speedBarrier(clsSprite barrier)
 {
     barrier.velocity *= 2;
     return(barrier);
 }
Ejemplo n.º 10
0
        /// <summary>
        /// LoadContent will be called once per game and is the place to load
        /// all of your content.
        /// </summary>
        protected override void LoadContent()
        {
            //Font Stuff
            Font1 = Content.Load <SpriteFont>("Courier New");

            #region Music Initialization Code
            // Load the SoundEffect resource
            menuEffect = Content.Load <SoundEffect>("MenuSoundEffect");

            // Load file built from XACT project
            audioEngine = new AudioEngine("Content\\Lab4Sounds.xgs");
            sounds      = new WaveBank(audioEngine, "Content\\Sounds.xwb");
            soundsBank  = new SoundBank(audioEngine, "Content\\SoundsBank.xsb");

            // Load streaming wave banks
            mainMenu  = new WaveBank(audioEngine, "Content\\MainMenu.xwb", 0, 4);
            settings  = new WaveBank(audioEngine, "Content\\Settings.xwb", 0, 4);
            credits   = new WaveBank(audioEngine, "Content\\Credits.xwb", 0, 4);
            easyAI    = new WaveBank(audioEngine, "Content\\EasyAI.xwb", 0, 4);
            medAI     = new WaveBank(audioEngine, "Content\\MediumAI.xwb", 0, 4);
            hardAI    = new WaveBank(audioEngine, "Content\\HardAI.xwb", 0, 4);
            twoPlayer = new WaveBank(audioEngine, "Content\\2Player.xwb", 0, 4);
            gameWin   = new WaveBank(audioEngine, "Content\\GameWin.xwb", 0, 4);

            // The audio engine must be updated before the streaming cues are ready
            audioEngine.Update();

            // Get cues for streaming music
            mainMenuCue  = soundsBank.GetCue("MainMenuMusic");
            settingsCue  = soundsBank.GetCue("SettingsMusic");
            creditsCue   = soundsBank.GetCue("Credits");
            easyAICue    = soundsBank.GetCue("EasyAI");
            medAICue     = soundsBank.GetCue("MediumAI");
            hardAICue    = soundsBank.GetCue("HardAI");
            twoPlayerCue = soundsBank.GetCue("2Player");
            winCue       = soundsBank.GetCue("GameWin");

            audioEngine.Update();
            settingsCue.Play();
            creditsCue.Play();
            easyAICue.Play();
            medAICue.Play();
            hardAICue.Play();
            twoPlayerCue.Play();
            mainMenuCue.Play();
            winCue.Play();
            #endregion

            gameSettings = new pongSettings();
            // Create a new SpriteBatch, which can be used to draw textures.
            spriteBatch = new SpriteBatch(GraphicsDevice);

            P1Game = new Lab4.PongGame(Content.Load <Texture2D>("paddle-ash"), Content.Load <Texture2D>("paddle-gary"), Content.Load <Texture2D>("barrier"), Content.Load <Texture2D>("pokeball"),
                                       Content.Load <Texture2D>(/*"ballSpeedUp"*/ "power-ball-fast"), Content.Load <Texture2D>(/*"ballSpeedDown"*/ "power-ball-slow"), Content.Load <Texture2D>(/*"barrierSpeedUp"*/ "power-barrier-speed"), Content.Load <Texture2D>(/*"barrierSpeedDown"*/ "power-barrier-slow"), graphics, 1);

            P2Game = new Lab4.PongGame(Content.Load <Texture2D>("paddle-ash"), Content.Load <Texture2D>("paddle-gary"), Content.Load <Texture2D>("barrier"), Content.Load <Texture2D>("pokeball"),
                                       Content.Load <Texture2D>(/*"ballSpeedUp"*/ "power-ball-fast"), Content.Load <Texture2D>(/*"ballSpeedDown"*/ "power-ball-slow"), Content.Load <Texture2D>(/*"barrierSpeedUp"*/ "power-barrier-speed"), Content.Load <Texture2D>(/*"barrierSpeedDown"*/ "power-barrier-slow"), graphics, 2);

            //Load 2D Content into the Sprites
            MainMenuSprite = new clsSprite(Content.Load <Texture2D>("menu-main"),
                                           new Vector2(0f, 0f), new Vector2(700f, 500f), graphics.PreferredBackBufferWidth, graphics.PreferredBackBufferHeight);
            #region Menu Buttons
            //Load 2D content into my MainMenuButton
            mainMenu1P = new clsButton(Content.Load <Texture2D>("arrow-right"), new Vector2(420, 30), false, false);
            mainMenu1P.setPosition(new Vector2(400, 152));
            mainMenu2P = new clsButton(Content.Load <Texture2D>("arrow-right"), new Vector2(420, 30), false, false);
            mainMenu2P.setPosition(new Vector2(400, 216));
            mainMenuSettings = new clsButton(Content.Load <Texture2D>("arrow-right"), new Vector2(420, 30), false, false);
            mainMenuSettings.setPosition(new Vector2(400, 280));
            mainMenuCredits = new clsButton(Content.Load <Texture2D>("arrow-right"), new Vector2(420, 30), false, false);
            mainMenuCredits.setPosition(new Vector2(400, 344));
            mainMenuQuit = new clsButton(Content.Load <Texture2D>("arrow-right"), new Vector2(420, 30), false, false);
            mainMenuQuit.setPosition(new Vector2(400, 442));
            #endregion

            gymSprite = new clsSprite(Content.Load <Texture2D>("gym2"),
                                      new Vector2(0f, 0f), new Vector2(graphics.PreferredBackBufferWidth, graphics.PreferredBackBufferHeight), graphics.PreferredBackBufferWidth, graphics.PreferredBackBufferHeight);
            creditScreen = new clsSprite(Content.Load <Texture2D>("menu-credits"),
                                         new Vector2(0f, 0f), new Vector2(graphics.PreferredBackBufferWidth, graphics.PreferredBackBufferHeight), graphics.PreferredBackBufferWidth, graphics.PreferredBackBufferHeight);

            settingsSprite = new clsSprite(Content.Load <Texture2D>("menu-settings"),
                                           new Vector2(0f, 0f), new Vector2(700f, 500f), graphics.PreferredBackBufferWidth, graphics.PreferredBackBufferHeight);
            #region Setting Buttons
            #region Barrier
            settingBarrierOn = new clsButton(Content.Load <Texture2D>("MenuLineBar"), new Vector2(61, 40), true, false);
            settingBarrierOn.setPosition(new Vector2(707, 151));
            settingBarrierOn.addColor();
            settingBarrierOff = new clsButton(Content.Load <Texture2D>("MenuLineBar"), new Vector2(92, 40), true, false);
            settingBarrierOff.setPosition(new Vector2(803, 151));
            #endregion
            #region PowerUps
            settingPowerUpsOn = new clsButton(Content.Load <Texture2D>("MenuLineBar"), new Vector2(61, 40), true, false);
            settingPowerUpsOn.setPosition(new Vector2(707, 215));
            settingPowerUpsOn.addColor();
            settingPowerUpsOff = new clsButton(Content.Load <Texture2D>("MenuLineBar"), new Vector2(92, 40), true, false);
            settingPowerUpsOff.setPosition(new Vector2(803, 215));
            #endregion
            #region Difficulty
            settingDifficulty1 = new clsButton(Content.Load <Texture2D>("MenuLineBar"), new Vector2(25, 30), true, false);
            settingDifficulty1.setPosition(new Vector2(711, 284));
            settingDifficulty1.addColor();
            settingDifficulty2 = new clsButton(Content.Load <Texture2D>("MenuLineBar"), new Vector2(30, 30), true, false);
            settingDifficulty2.setPosition(new Vector2(803, 284));
            settingDifficulty3 = new clsButton(Content.Load <Texture2D>("MenuLineBar"), new Vector2(30, 30), true, false);
            settingDifficulty3.setPosition(new Vector2(899, 284));

            #endregion
            #region Music
            settingMusicOn = new clsButton(Content.Load <Texture2D>("MenuLineBar"), new Vector2(61, 40), true, false);
            settingMusicOn.setPosition(new Vector2(707, 343));
            settingMusicOn.addColor();
            settingMusicOff = new clsButton(Content.Load <Texture2D>("MenuLineBar"), new Vector2(92, 40), true, false);
            settingMusicOff.setPosition(new Vector2(803, 343));
            #endregion
            settingExitButton = new clsButton(Content.Load <Texture2D>("MenuLineBar"), new Vector2(125, 40), false, false);
            settingExitButton.setPosition(new Vector2(319, 441));
            #endregion
            #region Pause Buttons and Sprites
            pauseScreen = new clsSprite(Content.Load <Texture2D>("pause"),
                                        new Vector2(0f, 0f), new Vector2(1248f, 623f), graphics.PreferredBackBufferWidth, graphics.PreferredBackBufferHeight);
            //Sprites
            pauseScreen1P = new clsSprite(Content.Load <Texture2D>("pause-1P"),
                                          new Vector2(0f, 0f), new Vector2(1248f, 623f), graphics.PreferredBackBufferWidth, graphics.PreferredBackBufferHeight);
            pauseScreen1P_Ball = new clsSprite(Content.Load <Texture2D>("pause-1P-ball"),
                                               new Vector2(0f, 0f), new Vector2(1248f, 623f), graphics.PreferredBackBufferWidth, graphics.PreferredBackBufferHeight);
            pauseScreen1P_Barrier = new clsSprite(Content.Load <Texture2D>("pause-1P-barrier"),
                                                  new Vector2(0f, 0f), new Vector2(1248f, 623f), graphics.PreferredBackBufferWidth, graphics.PreferredBackBufferHeight);
            pauseScreen1P_All = new clsSprite(Content.Load <Texture2D>("pause-1P-ball-barrier"),
                                              new Vector2(0f, 0f), new Vector2(1248f, 623f), graphics.PreferredBackBufferWidth, graphics.PreferredBackBufferHeight);

            pauseScreen2P = new clsSprite(Content.Load <Texture2D>("pause-2P"),
                                          new Vector2(0f, 0f), new Vector2(1248f, 623f), graphics.PreferredBackBufferWidth, graphics.PreferredBackBufferHeight);
            pauseScreen2P_Ball = new clsSprite(Content.Load <Texture2D>("pause-2P-ball"),
                                               new Vector2(0f, 0f), new Vector2(1248f, 623f), graphics.PreferredBackBufferWidth, graphics.PreferredBackBufferHeight);
            pauseScreen2P_Barrier = new clsSprite(Content.Load <Texture2D>("pause-2P-barrier"),
                                                  new Vector2(0f, 0f), new Vector2(1248f, 623f), graphics.PreferredBackBufferWidth, graphics.PreferredBackBufferHeight);
            pauseScreen2P_All = new clsSprite(Content.Load <Texture2D>("pause-2P-ball-barrier"),
                                              new Vector2(0f, 0f), new Vector2(1248f, 623f), graphics.PreferredBackBufferWidth, graphics.PreferredBackBufferHeight);


            //Buttons
            gameExitButton = new clsButton(Content.Load <Texture2D>("MenuLineBar"), new Vector2(404, 25), false, false);
            gameExitButton.setPosition(new Vector2(421, 324));
            pauseExitButton = new clsButton(Content.Load <Texture2D>("MenuLineBar"), new Vector2(297, 26), false, false);
            pauseExitButton.setPosition(new Vector2(421, 378));
            #endregion
            #region EndGame Sprites
            ashWin = new clsSprite(Content.Load <Texture2D>("win-ash"),
                                   new Vector2(0f, 0f), new Vector2(1248f, 623f), graphics.PreferredBackBufferWidth, graphics.PreferredBackBufferHeight);
            garyWin = new clsSprite(Content.Load <Texture2D>("win-gary"),
                                    new Vector2(0f, 0f), new Vector2(1248f, 623f), graphics.PreferredBackBufferWidth, graphics.PreferredBackBufferHeight);

            #endregion
        }
Ejemplo n.º 11
0
 public void move(clsSprite gameBall, KeyboardState movementKey, GameTime gameTime)
 {
     if (playerType == PongGame.PlayerType.PlayerOne)
     {
         if (movementKey.IsKeyDown(Keys.Up))
         {
             this.animateAsh(gameTime);
             paddle.velocity = new Vector2(0, -5);
             paddle.Move();
         }
         else if (movementKey.IsKeyDown(Keys.Down))
         {
             this.animateAsh(gameTime);
             paddle.velocity = new Vector2(0, 5);
             paddle.Move();
         }
     }
     else if (playerType == PongGame.PlayerType.PlayerTwo)
     {
         if (movementKey.IsKeyDown(Keys.W))
         {
             this.animateGary(gameTime);
             paddle.velocity = new Vector2(0, -5);
             paddle.Move();
         }
         else if (movementKey.IsKeyDown(Keys.S))
         {
             this.animateGary(gameTime);
             paddle.velocity = new Vector2(0, 5);
             paddle.Move();
         }
     }
     else if (playerType == PongGame.PlayerType.CPU)
     {
         //Add code for difficulty here regarding when the
         //paddle finds out where the ball is
         if (Game1.gameSettings.difficulty == pongSettings.Difficulty.Easy)
         {
             paddle.Move();
             this.animateGary(gameTime);
             paddle.withinScreen();
         }
         else if (Game1.gameSettings.difficulty == pongSettings.Difficulty.Medium)
         {
             if (gameBall.position.X - paddle.position.X < 50 && gameBall.position.Y > (paddle.center.Y - paddle.size.Y / 2))
             {
                 this.animateGary(gameTime);
                 paddle.velocity = new Vector2(0, 5);
                 paddle.Move();
             }
             else if (gameBall.position.X - paddle.position.X < 50 && gameBall.position.Y < (paddle.center.Y - paddle.size.Y / 2))
             {
                 this.animateGary(gameTime);
                 paddle.velocity = new Vector2(0, -5);
                 paddle.Move();
             }
             else
             {
                 this.animateGary(gameTime);
                 paddle.Move();
             }
             paddle.withinScreen();
         }
         else if (Game1.gameSettings.difficulty == pongSettings.Difficulty.Hard)
         {
             if (gameBall.position.X - paddle.position.X < 300 && gameBall.position.Y > (paddle.center.Y - paddle.size.Y / 2))
             {
                 this.animateGary(gameTime);
                 paddle.velocity = new Vector2(0, 5);
                 paddle.Move();
             }
             else if (gameBall.position.X - paddle.position.X < 300 && gameBall.position.Y < (paddle.center.Y - paddle.size.Y / 2))
             {
                 this.animateGary(gameTime);
                 paddle.velocity = new Vector2(0, -5);
                 paddle.Move();
             }
             else
             {
                 this.animateGary(gameTime);
                 paddle.Move();
             }
             paddle.withinScreen();
         }
     }
 }