Ejemplo n.º 1
0
	//================================================================//
	// StartNewGame
	//================================================================//
	// Create a new game with a different seed and reset appropriate 
	// information. 
	//================================================================//
	public void StartNewGame()
	{
		startSize = 5; 
		currentSquareSize = 5;
		currentDiversion = 100;
		ChangeSeed ();

		currentScore = 0;
		scoreDisplay.color = Color.white;
		highScoreMessage.enabled = false;
		currentScore +=currentSquareSize*(currentSquareSize-1)*10;

		MazeGenerator maze = new MazeGenerator(seedX, seedY, seedZ);
		PseudoRandom rnd = new PseudoRandom(seedX, seedY, seedZ);
		currentStart = maze.CreateRandomPoint(rnd, currentSquareSize, currentSquareSize);
		CreateNewLevel (currentStart);

		int[] startPoint = FindStart (currentMap);

		if (currentPlayer == null) {
			currentPlayer = (Player) Instantiate (player, gridMaster.GetCoordVect2(startPoint[0], startPoint[1]), Quaternion.identity);
		}
		inGame = true;
		currentPlayer.SetGridMaster (gridMaster);
		currentPlayer.SetLayout (this);
		//print (startPoint[0] + " - "+ startPoint[1]);
		currentPlayer.transform.position = gridMaster.GetCoordVect2 (startPoint [0], startPoint [1]);
		currentPlayer.currentCoord = startPoint;
	}