1
Fork 0
mirror of https://github.com/Steffo99/bleach-beach.git synced 2024-12-04 19:04:19 +00:00

Change in the point calculation alg.

This commit is contained in:
Lorenzo Balugani 2018-08-13 21:53:54 +02:00
parent cf2fe4e339
commit 1e04cc6a97

View file

@ -35,21 +35,16 @@ public class Countdown : MonoBehaviour {
ai1 = nave1.GetComponent<FishCatcher>(); ai1 = nave1.GetComponent<FishCatcher>();
ai2 = nave2.GetComponent<FishCatcher>(); ai2 = nave2.GetComponent<FishCatcher>();
ai3 = nave3.GetComponent<FishCatcher>(); ai3 = nave3.GetComponent<FishCatcher>();
int[] punteggi = { ai1.fishCaught, ai2.fishCaught, ai3.fishCaught}; int ai = ai1.fishCaught + ai2.fishCaught + ai3.fishCaught;
int score = presi.fishCaught; int score = presi.fishCaught;
string vincitore = "Player"; string vincitore = "Player";
for(int a = 0; a < 3; a++) if(ai > score)
{ {
if(punteggi[a] > score)
{
vincitore = "AI"; vincitore = "AI";
} }
}
Debug.Log(score); Debug.Log(score);
Debug.Log(vincitore); Debug.Log(vincitore);
Debug.Log(punteggi[0]); Debug.Log(ai);
Debug.Log(punteggi[1]);
Debug.Log(punteggi[2]);
PlayerPrefs.SetInt("player_score", score); PlayerPrefs.SetInt("player_score", score);
PlayerPrefs.SetString("winner", vincitore); PlayerPrefs.SetString("winner", vincitore);
SceneManager.LoadSceneAsync("Results", LoadSceneMode.Single); SceneManager.LoadSceneAsync("Results", LoadSceneMode.Single);