void findingCombo3() { thisDir = whichDir.right; DetermineRotDir(); if (/*comboNum3Reached == false && */ (int)dialAngle <= dialNum3 + 5 && (int)dialAngle >= dialNum3 - 1) { print("Getting Close to the right number"); //TODO Add vibration/sound to indicate that the dial is nearing the correct number if ((int)dialAngle <= dialNum3 + 1 && (int)dialAngle >= dialNum3 - 1) { /*TODO Increase vibration/sound volume to indicate that the player has reached the correct number * If the player stops the dial in the correct position for a second, they will unlock the first combo number and be allowed to continue*/ if (comboStayTimer > 0.0f) { comboStayTimer = comboStayTimer - (1.0f * Time.deltaTime); } else if (comboStayTimer <= 0.0f) { //comboNum3Reached = true; currentState = lockState.unlocked; print("You found the THIRD DIGIT! DOOR UNLOCKED"); } } } else if ((int)dialAngle < dialNum3 - 1 && (int)dialAngle >= dialNum3 - 3) { puzzleAttempts++; currentState = lockState.failed; } else { comboStayTimer = 2.0f; } }
void findingCombo2() { thisDir = whichDir.left; DetermineRotDir(); //TODO Does the dial need to pass 0 before going to the next digit? If so, just use a "passedZero" bool if (/*comboNum2Reached == false && */ (int)dialAngle >= dialNum2 - 5 && (int)dialAngle <= dialNum2 + 1) { print("Getting Close to the right number"); //TODO Add vibration/sound to indicate that the dial is nearing the correct number if ((int)dialAngle <= dialNum2 + 1 && (int)dialAngle >= dialNum2 - 1) { /*TODO Increase vibration/sound volume to indicate that the player has reached the correct number * If the player stops the dial in the correct position for a second, they will unlock the first combo number and be allowed to continue*/ if (comboStayTimer > 0.0f) { comboStayTimer = comboStayTimer - 1.0f * Time.deltaTime; } else if (comboStayTimer <= 0.0f) { //comboNum2Reached = true; currentState = lockState.findCombo3; print("You found the SECOND DIGIT"); } } } else if ((int)dialAngle > dialNum2 + 1 && dialAngle <= dialNum2 + 3) { puzzleAttempts++; currentState = lockState.failed; } else { comboStayTimer = 2.0f; } }