// Update is called once per frame void Update() { if (!victorious) { if (victory()) { if (dataCollector != null) { dataCollector.setOutcome("victory"); } else { Debug.Log("Warning: DataCollector not found in scene (Ignore if running this scene in isolation)."); } victories++; dataCollector.AddKey(); // add one to the counts of total key fragments obtained Debug.Log("added a Key!!!!!!!!!!!!!"); //resultStr +="OUTCOME,VICTORY,"; displayOptions(); //Cheryl // yes.onClick.AddListener(newGame); no.onClick.AddListener(saveAndQuit); vicJingle_tile.Play(); // play victory music // if(yes.onClick){ // newGame(); // } // else if{ // // } } else if (!controlsDisabled && Input.GetKeyDown(KeyCode.DownArrow)) { turnDown(); tryMove(); } else if (!controlsDisabled && Input.GetKeyDown(KeyCode.UpArrow)) { turnUp(); tryMove(); } else if (!controlsDisabled && Input.GetKeyDown(KeyCode.RightArrow)) { turnRight(); tryMove(); } else if (!controlsDisabled && Input.GetKeyDown(KeyCode.LeftArrow)) { turnLeft(); tryMove(); } } }
/* * private void countLeftRightSymmetry(string newLoc) { * if(left_squares_list.Contains (newLoc)) { * left_squares_player++; * } else if (right_squares_list.Contains (newLoc)) { * right_squares_player++; * } * } * * private void countTopBottomSymmetry(string newLoc) { * if(bottom_squares_list.Contains (newLoc)) { * bottom_squares_player++; * } else if (top_squares_list.Contains (newLoc)) { * top_squares_player++; * } * } * * private void countIceSymmetry() { * foreach(iceBlock i in ices) { * int[,] iceSquaresExplored = i.getSquaresExplored(); * for(int row = 0; row < NUM_ROWS; row++) { * for(int col = 0; col < NUM_COLS; col++) { * string squareVisited = "" + (row + 1) + "" + (col + 1); * if(left_squares_list.Contains(squareVisited)) { * left_squares_ice += iceSquaresExplored[row,col]; * } else if(right_squares_list.Contains(squareVisited)) { * right_squares_ice += iceSquaresExplored[row,col]; * } * * if(top_squares_list.Contains(squareVisited)) { * top_squares_ice += iceSquaresExplored[row,col]; * } else if(bottom_squares_list.Contains(squareVisited)) { * bottom_squares_ice += iceSquaresExplored[row,col]; * } * * } * } * } * * } */ // Update is called once per frame void Update() { if (!victorious) { if (victory()) { if (dataCollector != null) { dataCollector.setOutcome("victory"); } else { Debug.Log("Warning: DataCollector not found in scene."); } logEndGameData(); //resultStr +="OUTCOME,VICTORY,"; victories++; if (timer != null) // timed level { // give player the Rocket Boots? Debug.Log("Got the Rocket Boots!"); gotRocketBoots = true; } else if (dataCollector != null && timer == null) //non-timed level { dataCollector.AddKey(); // add one to the counts of total key fragments obtained Debug.Log("added a Key!!!!!!!!!!!!!"); } vicJingle.Play(); displayOptions(); } else if (Input.GetKeyDown(KeyCode.DownArrow)) { if (!timedOut) { // turn down turnDown(); // move down tryMove(); } } else if (Input.GetKeyDown(KeyCode.UpArrow)) { if (!timedOut) { // turn up turnUp(); // move up tryMove(); } } else if (Input.GetKeyDown(KeyCode.RightArrow)) { if (!timedOut) { // turn right turnRight(); // move right tryMove(); } } else if (Input.GetKeyDown(KeyCode.LeftArrow)) { if (!timedOut) { // turn left turnLeft(); // move left tryMove(); } } } else if (gotRocketBoots) { if (Input.GetKeyDown(KeyCode.Space)) { StartCoroutine(blastThroughCeiling(1f)); // blast through ceiling and then fade to end demo unDisplayOptions(); } } }