public override void HandleInput(InputState input)
        {
            mousePoint = new Point((int)(input.CurrentMouseStates[(int)PlayerIndex.One].X), (int)(input.CurrentMouseStates[(int)PlayerIndex.One].Y));

            if (zoomScale > 1.0f || zoomScale < 1.0f)
            {
                #region Move Zoomed Screen
                if (input.CurrentMouseStates[(int)PlayerIndex.One].LeftButton == ButtonState.Pressed)
                {

                    if (input.CurrentMouseStates[(int)PlayerIndex.One].X != input.PreviousMouseStates[(int)PlayerIndex.One].X)
                    {

                        cameraPosition -= new Vector2(input.CurrentMouseStates[(int)PlayerIndex.One].X - input.PreviousMouseStates[(int)PlayerIndex.One].X, input.CurrentMouseStates[(int)PlayerIndex.One].Y - input.PreviousMouseStates[(int)PlayerIndex.One].Y);

                    }
                }
                #endregion
            }
            else
            {
                #region Pause
                KeyboardState keyboardState = input.CurrentKeyboardStates[(int)PlayerIndex.One];
                GamePadState gamePadState = input.CurrentGamePadStates[(int)PlayerIndex.One];

                bool playerOneGamePadDisconnected = !gamePadState.IsConnected &&
                                            input.GamePadWasConnected[(int)PlayerIndex.One];

                //...if so then pause and wait
                if (input.IsPauseGame(PlayerIndex.One) || playerOneGamePadDisconnected)
                {
                    if (LevelName != null)
                    {
                        ScreenManager.AddScreen(new PauseMenuScreen(Tiles, Backgrounds, LevelName, scrollOffset), PlayerIndex.One);

                    }
                    else
                    {
                        ScreenManager.AddScreen(new PauseMenuScreen(Tiles, Backgrounds, String.Empty, scrollOffset), PlayerIndex.One);
                    }

                }
                #endregion

                #region GetTiles
                //add references here
                if (input.CurrentKeyboardStates[(int)PlayerIndex.One].IsKeyDown(Keys.LeftShift) && input.PreviousKeyboardStates[(int)PlayerIndex.One].IsKeyUp(Keys.LeftShift))
                {
                    ScreenManager.AddScreen(new ObjectSelection(tileReferenceBlocks, tileReferenceSceneries, tileReferenceSlopes, tileSelectionBox, fileReferences, SpriteBatch), PlayerIndex.One);
                }

                #endregion

                #region GetBackgrounds

                if (input.CurrentKeyboardStates[(int)PlayerIndex.One].IsKeyDown(Keys.RightShift) && input.PreviousKeyboardStates[(int)PlayerIndex.One].IsKeyUp(Keys.RightShift))
                {
                    //do this for background creation
                    ScreenManager.AddScreen(new ObjectSelectionBackgrounds(normalBackgroundReferences, otherBackgroundReferences, backgroundFileReferences, tileSelectionBox, SpriteBatch), PlayerIndex.One);
                }

                #endregion

                #region SelectAllowedObject
                if (!tileSelected && !backgroundSelected)
                {
                    if (input.CurrentKeyboardStates[(int)PlayerIndex.One].IsKeyDown(Keys.D1) && input.PreviousKeyboardStates[(int)PlayerIndex.One].IsKeyUp(Keys.D1))
                    {
                        allowedObject = AllowedObject.Tile;

                    }
                    if (input.CurrentKeyboardStates[(int)PlayerIndex.One].IsKeyDown(Keys.D2) && input.PreviousKeyboardStates[(int)PlayerIndex.One].IsKeyUp(Keys.D2))
                    {
                        allowedObject = AllowedObject.Background;

                    }
                    if (input.CurrentKeyboardStates[(int)PlayerIndex.One].IsKeyDown(Keys.D3) && input.PreviousKeyboardStates[(int)PlayerIndex.One].IsKeyUp(Keys.D3))
                    {
                        allowedObject = AllowedObject.Scenery;

                    }
                    if (input.CurrentMouseStates[(int)PlayerIndex.One].ScrollWheelValue > input.PreviousMouseStates[(int)PlayerIndex.One].ScrollWheelValue)
                    {
                        allowedObject--;

                        if (allowedObject < 0)
                            allowedObject = AllowedObject.Scenery;
                    }
                    if (input.CurrentMouseStates[(int)PlayerIndex.One].ScrollWheelValue < input.PreviousMouseStates[(int)PlayerIndex.One].ScrollWheelValue)
                    {
                        allowedObject++;

                        if (allowedObject > AllowedObject.Scenery)
                            allowedObject = 0;
                    }

                    if (allowedObject == AllowedObject.Tile)
                    {
                        numberOneColor = Color.Red;
                        numberTwoColor = Color.White;
                        numberThreeColor = Color.White;
                    }
                    else if (allowedObject == AllowedObject.Background)
                    {
                        numberOneColor = Color.White;
                        numberTwoColor = Color.Red;
                        numberThreeColor = Color.White;
                    }
                    else if (allowedObject == AllowedObject.Scenery)
                    {
                        numberOneColor = Color.White;
                        numberTwoColor = Color.White;
                        numberThreeColor = Color.Red;
                    }
                }

                #endregion

                if (!toggleCameraMove)
                {
                    #region SelectObjects Mouse
                    if (input.CurrentMouseStates[(int)PlayerIndex.One].LeftButton == ButtonState.Pressed && input.PreviousMouseStates[(int)PlayerIndex.One].LeftButton == ButtonState.Released ||
                        input.CurrentKeyboardStates[(int)PlayerIndex.One].IsKeyDown(Keys.Space) && input.PreviousKeyboardStates[(int)PlayerIndex.One].IsKeyUp(Keys.Space))
                    {
                        if (allowedObject == AllowedObject.Tile || allowedObject == AllowedObject.Scenery)
                        {
                            if (!tileSelected)
                            {
                                for (int i = Tiles.Count - 1; i >= 0; i--)
                                {
                                    if (Tiles[i].type == TileType.Scenery && allowedObject == AllowedObject.Scenery)
                                    {
                                        if (Tiles[i].objectNumber == 15 || Tiles[i].objectNumber == 16)
                                        {
                                            tileRectangles[i] = new Rectangle((int)(Tiles[i].position.X + scrollOffset.X), (int)(Tiles[i].position.Y + scrollOffset.Y), 10, 10);
                                        }
                                        else
                                        {
                                            tileRectangles[i] = new Rectangle((int)(Tiles[i].position.X + scrollOffset.X), (int)(Tiles[i].position.Y + scrollOffset.Y), Tiles[i].sprite.Width, Tiles[i].sprite.Height);
                                        }

                                        if (tileRectangles[i].Contains(mousePoint))
                                        {
                                            tileSelected = true;
                                            tileNumber = i;
                                            break;
                                        }
                                    }
                                    if (Tiles[i].type != TileType.Scenery && allowedObject == AllowedObject.Tile)
                                    {

                                        tileRectangles[i] = new Rectangle((int)(Tiles[i].position.X + scrollOffset.X), (int)(Tiles[i].position.Y + scrollOffset.Y), Tiles[i].sprite.Width, Tiles[i].sprite.Height);

                                        if (tileRectangles[i].Contains(mousePoint))
                                        {
                                            tileSelected = true;
                                            tileNumber = i;
                                            break;
                                        }
                                    }
                                }
                            }
                            else
                            {
                                tileSelected = false;
                                tileRectangles[tileNumber] = new Rectangle((int)(Tiles[tileNumber].position.X + scrollOffset.X), (int)(Tiles[tileNumber].position.Y + scrollOffset.Y), Tiles[tileNumber].sprite.Width, Tiles[tileNumber].sprite.Height);
                                return;
                            }
                        }
                        if (allowedObject == AllowedObject.Background)
                        {
                            if (!backgroundSelected)
                            {
                                for (int i = Backgrounds.Count - 1; i >= 0; i--)
                                {

                                    backgroundRectangles[i] = new Rectangle((int)(Backgrounds[i].position.X + scrollOffset.X), (int)(Backgrounds[i].position.Y + scrollOffset.Y), Backgrounds[i].sprite.Width, Backgrounds[i].sprite.Height);

                                    if (backgroundRectangles[i].Contains(mousePoint))
                                    {
                                        backgroundSelected = true;
                                        tileNumber = i;
                                        break;
                                    }
                                }
                            }
                            else
                            {

                                backgroundSelected = false;
                                backgroundRectangles[tileNumber] = new Rectangle((int)(Backgrounds[tileNumber].position.X + scrollOffset.X), (int)(Backgrounds[tileNumber].position.Y + scrollOffset.Y), Backgrounds[tileNumber].sprite.Width, Backgrounds[tileNumber].sprite.Height);
                                return;
                            }
                        }
                    }
                    #endregion

                }
                else
                {
                    #region MoveCamera
                    if (input.CurrentMouseStates[(int)PlayerIndex.One].LeftButton == ButtonState.Pressed)
                    {

                        if (input.CurrentMouseStates[(int)PlayerIndex.One].X != input.PreviousMouseStates[(int)PlayerIndex.One].X)
                        {

                            cameraPosition -= new Vector2(input.CurrentMouseStates[(int)PlayerIndex.One].X - input.PreviousMouseStates[(int)PlayerIndex.One].X, input.CurrentMouseStates[(int)PlayerIndex.One].Y - input.PreviousMouseStates[(int)PlayerIndex.One].Y);

                        }
                    }
                    #endregion

                }

                #region Move Tile
                if (tileSelected)
                {

                    if (input.CurrentKeyboardStates[(int)PlayerIndex.One].IsKeyDown(Keys.A) && input.PreviousKeyboardStates[(int)PlayerIndex.One].IsKeyUp(Keys.A))
                    {
                        Tiles[tileNumber].position.X -= 1;
                    }
                    if (input.CurrentKeyboardStates[(int)PlayerIndex.One].IsKeyDown(Keys.D) && input.PreviousKeyboardStates[(int)PlayerIndex.One].IsKeyUp(Keys.D))
                    {
                        Tiles[tileNumber].position.X += 1;
                    }
                    if (input.CurrentKeyboardStates[(int)PlayerIndex.One].IsKeyDown(Keys.W) && input.PreviousKeyboardStates[(int)PlayerIndex.One].IsKeyUp(Keys.W))
                    {
                        Tiles[tileNumber].position.Y -= 1;
                    }
                    if (input.CurrentKeyboardStates[(int)PlayerIndex.One].IsKeyDown(Keys.S) && input.PreviousKeyboardStates[(int)PlayerIndex.One].IsKeyUp(Keys.S))
                    {
                        Tiles[tileNumber].position.Y += 1;
                    }

                    Tiles[tileNumber].position += new Vector2(input.CurrentMouseStates[(int)PlayerIndex.One].X - input.PreviousMouseStates[(int)PlayerIndex.One].X, input.CurrentMouseStates[(int)PlayerIndex.One].Y - input.PreviousMouseStates[(int)PlayerIndex.One].Y);

                }
                #endregion

                #region MoveBackground

                if (backgroundSelected)
                {

                    if (input.CurrentKeyboardStates[(int)PlayerIndex.One].IsKeyDown(Keys.A) && input.PreviousKeyboardStates[(int)PlayerIndex.One].IsKeyUp(Keys.A))
                    {
                        Backgrounds[tileNumber].position.X -= 1;
                    }
                    if (input.CurrentKeyboardStates[(int)PlayerIndex.One].IsKeyDown(Keys.D) && input.PreviousKeyboardStates[(int)PlayerIndex.One].IsKeyUp(Keys.D))
                    {
                        Backgrounds[tileNumber].position.X += 1;
                    }
                    if (input.CurrentKeyboardStates[(int)PlayerIndex.One].IsKeyDown(Keys.W) && input.PreviousKeyboardStates[(int)PlayerIndex.One].IsKeyUp(Keys.W))
                    {
                        Backgrounds[tileNumber].position.Y -= 1;
                    }
                    if (input.CurrentKeyboardStates[(int)PlayerIndex.One].IsKeyDown(Keys.S) && input.PreviousKeyboardStates[(int)PlayerIndex.One].IsKeyUp(Keys.S))
                    {
                        Backgrounds[tileNumber].position.Y += 1;
                    }

                    Backgrounds[tileNumber].position += new Vector2(input.CurrentMouseStates[(int)PlayerIndex.One].X - input.PreviousMouseStates[(int)PlayerIndex.One].X, input.CurrentMouseStates[(int)PlayerIndex.One].Y - input.PreviousMouseStates[(int)PlayerIndex.One].Y);
                }

                #endregion

                #region CopyTile

                if (input.CurrentKeyboardStates[(int)PlayerIndex.One].IsKeyDown(Keys.C) && input.PreviousKeyboardStates[(int)PlayerIndex.One].IsKeyUp(Keys.C))
                {
                    if (tileSelected)
                    {
                        tileSelected = false;
                        LoadTile(Tiles[tileNumber].type, Tiles[tileNumber].objectNumber, Tiles[tileNumber].layerNumber);
                    }
                    if (backgroundSelected)
                    {
                        backgroundSelected = false;
                        LoadBackground(Backgrounds[tileNumber].type, Backgrounds[tileNumber].objectNumber, Backgrounds[tileNumber].layerNumber);
                    }

                }

                #endregion

                #region DeleteTile

                if (input.CurrentKeyboardStates[(int)PlayerIndex.One].IsKeyDown(Keys.Delete) && input.PreviousKeyboardStates[(int)PlayerIndex.One].IsKeyUp(Keys.Delete))
                {
                    if (tileSelected)
                    {
                        tileSelected = false;
                        Tiles.RemoveAt(tileNumber);
                    }
                    if (backgroundSelected)
                    {
                        backgroundSelected = false;
                        Backgrounds.RemoveAt(tileNumber);
                    }

                }

                #endregion
            }

            #region Zoom Screen
            if (!tileSelected && !backgroundSelected)
            {
                if (input.CurrentKeyboardStates[(int)PlayerIndex.One].IsKeyDown(Keys.OemPlus) && input.PreviousKeyboardStates[(int)PlayerIndex.One].IsKeyUp(Keys.OemPlus))
                {
                    zoomScale += 0.1f;
                    if (zoomScale > 2.0f)
                        zoomScale -= 0.1f;
                }
                if (input.CurrentKeyboardStates[(int)PlayerIndex.One].IsKeyDown(Keys.OemMinus) && input.PreviousKeyboardStates[(int)PlayerIndex.One].IsKeyUp(Keys.OemMinus))
                {
                    zoomScale -= 0.1f;
                    if (zoomScale < 0.0f)
                        zoomScale += 0.1f;
                }
                if (input.CurrentKeyboardStates[(int)PlayerIndex.One].IsKeyDown(Keys.D0) && input.PreviousKeyboardStates[(int)PlayerIndex.One].IsKeyUp(Keys.D0))
                {
                    zoomScale = 1.0f;
                }
            }

            #endregion

            #region ToggleCamera
            if (input.CurrentKeyboardStates[(int)PlayerIndex.One].IsKeyDown(Keys.LeftControl))
            {
                toggleCameraMove = true;
            }
            else
            {
                toggleCameraMove = false;
            }
            #endregion
        }
        /// <summary>
        /// Check for input
        /// </summary>
        /// <param name="input">grabs the values from InputState</param>
        public override void HandleInput(InputState input)
        {
            if (!LevelCreateSession)
            {

                if (input == null)
                    throw new ArgumentNullException("input");

                //did you disconnect? //Switch this to two players if we want both players to be able to pause
                #region IsPlayerControllerDisconnectedOrOutOfBatteries?

                KeyboardState keyboardState = input.CurrentKeyboardStates[(int)PlayerIndex.One];
                GamePadState gamePadState = input.CurrentGamePadStates[(int)PlayerIndex.One];

                bool playerOneGamePadDisconnected = !gamePadState.IsConnected &&
                                            input.GamePadWasConnected[(int)PlayerIndex.One];

                //...if so then pause and wait
                if (input.IsPauseGame(PlayerIndex.One) || playerOneGamePadDisconnected)
                {

                    ScreenManager.AddScreen(new PauseMenuScreen(), PlayerIndex.One);

                }

                #endregion

                #region Move Left and Right

                if (input.CurrentKeyboardStates[(int)PlayerIndex.One].IsKeyDown(Keys.Right))
                {
                    player.velocity.X = 3.0f;
                }
                else if (input.CurrentKeyboardStates[(int)PlayerIndex.One].IsKeyDown(Keys.Left))
                {
                    player.velocity.X = -3.0f;
                }
                else
                {
                    player.velocity.X = 0;
                }

                #endregion

                #region Fly/Jump
                //if we press and hold A then velocity is applied, or its just 0
                //if we press and hold A and still flying energy then we fly, or we just float on down due to gravity but the flying energy doesn't replenish unless we've hit something
                if (input.CurrentKeyboardStates[(int)PlayerIndex.One].IsKeyDown(Keys.Space) && flyingAllowed)
                {
                    player.velocity.Y = -2;
                    flyingBarScalar = -2;
                    gravityAcceleration = 0;
                }
                else
                {
                    flyingBarScalar = 0;
                    gravityAcceleration = .1f;

                }
                //CheckImaginaryRectangles();
                HandleTileCollision();
                #endregion

            }

            refInput = input;
        }