public override void Update(GameTime gameTime)
        {
            currentWeapon.Update(gameTime, position, rotation);
            if (currentWeapon is Shield)
            {
                Shield s = currentWeapon as Shield;
                s.UpdateWeapFirePosition(Position, Rotation);
            }
            currFireTime       = currFireTime.Subtract(gameTime.ElapsedGameTime);
            betweenDodge       = betweenDodge.Subtract(gameTime.ElapsedGameTime);
            invincibleTime     = invincibleTime.Subtract(gameTime.ElapsedGameTime);
            pressedPowerUpTime = pressedPowerUpTime.Subtract(gameTime.ElapsedGameTime);
            if (isInvincible)
            {
                flickerTime = flickerTime.Subtract(gameTime.ElapsedGameTime);
            }
            if (invincibleTime.TotalSeconds <= 0)
            {
                isInvincible = false;
            }
            if (isPoweredUp)
            {
                powerUpTime = powerUpTime.Subtract(gameTime.ElapsedGameTime);
            }
            if (powerUpTime.TotalSeconds <= 0)
            {
                isPoweredUp = false;
                currentWeapon.CurrentLevel = 0;
            }
            if (cameraEnabled)
            {
                if (!bossMode)
                {
                    Camera.Instance.UpdateCamera(CameraStaticPosition, Vector3.Zero);
                }
                else
                {
                    Camera.Instance.UpdateCamera(position, Vector3.UnitY * rotation.Y);
                }
            }
            sphere   = new BoundingSphere(position, 6);
            worldMat = Matrix.CreateScale(0.1f) * Matrix.CreateRotationY(rotation.Y) * Matrix.CreateRotationZ(rotation.Z) * Matrix.CreateTranslation(position);

            if (!controls.Locked)
            {
                velocity = controls.UpdatePlayerMovement(position, rotation);
            }
            else
            {
                if (initialLock)
                {
                    velocity = new Vector3(0, 0, 1.3f);
                    if (position.Z > 0)
                    {
                        // controls.Locked = false;
                        velocity    = Vector3.Zero;
                        initialLock = false;
                    }
                }
            }

            if (velocity.X != 0.0f && velocity.Z != 0.0f)
            {
                velocity /= (float)Math.Sqrt(2); // don't want diagonal speed to be faster
            }

            if (bossMode)
            {
                oldPos = position;
            }

            if (bossMode && !controls.Locked) //move around the boss when going left/right
            {
                if (velocity.X != 0)
                {
                    velocity = getRotationVelocityAroundPoint(velocity, bossCenter);
                }
            }
            #region Player dodge logic
            if (controls.isPlayerDodgingLeft())
            {
                pressedDodgeLeft  = true;
                pressedDodgeRight = false;
            }
            if (controls.isPlayerDodgingRight())
            {
                pressedDodgeRight = true;
                pressedDodgeLeft  = false;
            }

            if (pressedDodgeLeft && !pressedDodgeRight)
            {
                if (betweenDodge.TotalSeconds <= 0)
                {
                    dodgeTime = dodgeTime.Subtract(gameTime.ElapsedGameTime);
                    if (dodgeTime.TotalSeconds > 0)
                    {
                        velocity = Vector3.UnitX * 5;
                    }
                    else
                    {
                        pressedDodgeLeft = false;
                        dodgeTime        = TimeSpan.FromSeconds(dodgeTimeSeconds);
                        betweenDodge     = TimeSpan.FromSeconds(betweenDodgeSeconds);
                    }
                }
            }

            if (pressedDodgeRight && !pressedDodgeLeft)
            {
                if (betweenDodge.TotalSeconds <= 0)
                {
                    dodgeTime = dodgeTime.Subtract(gameTime.ElapsedGameTime);
                    if (dodgeTime.TotalSeconds > 0)
                    {
                        velocity = -Vector3.UnitX * 5;
                    }
                    else
                    {
                        pressedDodgeRight = false;
                        dodgeTime         = TimeSpan.FromSeconds(dodgeTimeSeconds);
                        betweenDodge      = TimeSpan.FromSeconds(betweenDodgeSeconds);
                    }
                }
            }
            #endregion

            position += velocity;
            #region Player rotation while moving
            if (velocity.X < 0)
            {
                if (rotation.Z == 0 || rotation.Z > MathHelper.ToRadians(180))
                {
                    rotate(new Vector3(0, 0, MathHelper.ToRadians(3)));
                }
                else
                {
                    if (rotation.Z > 0 && rotation.Z <= MathHelper.ToRadians(180))
                    {
                        if (rotation.Z < MathHelper.ToRadians(30))
                        {
                            rotate(new Vector3(0, 0, MathHelper.ToRadians(3)));
                        }
                    }
                }
            }
            else if (velocity.X > 0)
            {
                if (rotation.Z == 0 || rotation.Z > 0 && rotation.Z <= MathHelper.ToRadians(180))
                {
                    rotate(new Vector3(0, 0, -MathHelper.ToRadians(3)));
                }
                else
                {
                    if (rotation.Z > MathHelper.ToRadians(180))
                    {
                        if (rotation.Z > MathHelper.ToRadians(330))
                        {
                            rotate(new Vector3(0, 0, -MathHelper.ToRadians(3)));
                        }
                    }
                }
            }
            else
            {
                if (rotation.Z > 0 && rotation.Z <= MathHelper.ToRadians(180))
                {
                    rotate(new Vector3(0, 0, -MathHelper.ToRadians(3)));
                }
                else if (rotation.Z > MathHelper.ToRadians(180))
                {
                    rotate(new Vector3(0, 0, MathHelper.ToRadians(3)));
                }
                if (MathHelper.ToDegrees(rotation.Z) < 3)
                {
                    rotation.Z = 0;
                }
            }
            #endregion

            if (position.X > 60)
            {
                position.X = 60;
            }
            if (position.X < -60)
            {
                position.X = -60;
            }

            if (!controls.Locked)
            {
                if (position.Z < -40)
                {
                    position.Z = -40;
                }
                if (position.Z > 40)
                {
                    position.Z = 40;
                }
            }

            if (controls.isPlayerFiring())
            {
                //is the player allowed to fire again since his last fire?
                if (currFireTime.TotalSeconds <= 0)
                {
                    //Reset current time
                    currFireTime = TimeSpan.FromTicks(currentWeapon.FireTime.Ticks);
                    fire();
                }
            }

            if (controls.isPlayerUsingPowerup())
            {
                if (pressedPowerUpTime.TotalSeconds <= 0)
                {
                    if (!isPoweredUp)
                    {
                        if (powerup < 394)
                        {
                            playerAVC.playSoundEffect("cancel", 1);
                        }
                        else
                        {
                            isPoweredUp = true;
                            powerUpTime = TimeSpan.FromSeconds(powerupTimeSeconds);
                            if (powerup >= 394 && powerup < 788)
                            {
                                currentWeapon.CurrentLevel = 1;
                                powerup -= 394;
                            }
                            else if (powerup >= 788 && powerup < 1182)
                            {
                                currentWeapon.CurrentLevel = 2;
                                powerup -= 788;
                            }
                            else
                            {
                                currentWeapon.CurrentLevel = 3;
                                powerup -= 1182;
                            }
                        }
                    }
                    pressedPowerUpTime = TimeSpan.FromSeconds(pressedPowerUpTimeSeconds);
                }
            }
            if (Game1.debug)
            {
                if (controls.isPlayerPowering(gameTime))
                {
                    if (currentWeapon.CurrentLevel < 3)
                    {
                        currentWeapon.CurrentLevel++;
                    }
                    else
                    {
                        currentWeapon.CurrentLevel = 0;
                    }
                }

                if (controls.isPlayerSwitching(gameTime))
                {
                    int loc = Array.IndexOf(weapList, currentWeapon.Name.ToString());
                    if (loc < weapList.Length - 1)
                    {
                        changeWeapon((PlayerWeaponName)Enum.Parse(typeof(PlayerWeaponName), weapList[loc + 1], true));
                    }
                    else
                    {
                        changeWeapon((PlayerWeaponName)Enum.Parse(typeof(PlayerWeaponName), weapList[0], true));
                    }
                }
            }
        }