Asteroids.Classes.KeyBindingsContent.Update C# (CSharp) Method

Update() public method

public Update ( ) : void
return void
        public void Update()
        {
            count++;
            if (count % 5 == 0)
            {
                if (controlsEnabled)
                {
                    if(controlHandler.GetInput().Contains("Back"))
                    {
                        backKeyPress = true;
                    }

                    if (controlHandler.GetInput().Contains("Right") || controlHandler.GetInput().Contains("Left"))
                    {
                        if (posX < xPositions.Length - 1)
                            posX = 1;
                        else
                            posX = 0;
                    }
                    if (controlHandler.GetInput().Contains("Up"))
                    {
                        if (posY > 0)
                            posY--;
                        else
                            posY = 10;
                    }
                    if (controlHandler.GetInput().Contains("Down"))
                    {
                        if (posY > 9)
                            posY = 0;
                        else
                            posY++;
                    }
                }
            }

            if (controlHandler.GetInput().Contains("Select"))
            {
                if(count % 7 == 0)
                {
                    if (posY < 10 && (posX == 0 || posX == 1 && controlHandler.GetNumberOfWiimotes() > 0))
                    {
                        EmptyKeybind();
                    }
                    else
                    {
                        if (posX == 0)
                            DiscardChanges();
                        if (posX == 1)
                            SaveChanges();
                    }
                }
            }

            if (count % 10 == 0)
            {
                if (!controlsEnabled)
                {
                    if (posX == 0)
                        RebindKBKey();
                    else if (posX == 1)
                        RebindWMKey();
                }
            }

            pointerPos = new Vector2(xPositions[posX], yPositions[posY]);

            if(savePrompt == true)
            {
                promptTimer++;
                if (promptTimer > 75)
                {
                    fadeValue += 0.02f;
                    promptColor = Color.Lerp(new Color(255, 222, 0), new Color(0, 0, 0), fadeValue);
                }
                if(promptTimer > 150)
                {
                    savePrompt = false;
                    promptColor = new Color(255, 222, 0);
                    fadeValue = 0;
                    promptTimer = 0;
                }
            }

            if(canSave == false)
            {
                saveTimer++;
                if(saveTimer > 75)
                {
                    saveFadeValue += 0.02f;
                    promptColor = Color.Lerp(new Color(255, 222, 0), new Color(0, 0, 0), saveFadeValue);
                }
                if(saveTimer > 150)
                {
                    canSave = true;
                    promptColor = new Color(255, 222, 0);
                    saveFadeValue = 0;
                    saveTimer = 0;
                }
            }

            if(reset)
            {
                resetTimer++;
                if(resetTimer > 75)
                {
                    resetFadeValue += 0.02f;
                    promptColor = Color.Lerp(new Color(255, 222, 0), new Color(0, 0, 0), resetFadeValue);
                }
                if (resetTimer > 150)
                {
                    reset = false;
                    promptColor = new Color(255, 222, 0);
                    resetFadeValue = 0;
                    resetTimer = 0;
                }
            }
        }