/// <summary> /// Fills up the map by creating new lanes /// </summary> private void FillUpMap(int maxLaneCount) { // Fill up the screen with random sets int curLaneCount = 0; while (curLaneCount < maxLaneCount) { // Get a new lane set if the current set is complete if (m_currentLaneSet != null) { if (m_currentLaneSet.IsSetComplete) { GetNewLaneSet(); } } curLaneCount += m_currentLaneSet.CreateLanes(maxLaneCount - curLaneCount); } }
/// <summary> /// Starts creating the map. /// </summary> private void StartCreateMap() { // Deactivate previously used lanes foreach (Lane lane in m_activeLaneList) { lane.Deactivate(); } m_activeLaneList.Clear(); // Initialize variables m_currentLaneSet = null; m_lowestRowCoord = m_startRowCoord; m_highestRowCoord = m_startRowCoord; // Create the starting set m_currentLaneSet = new BeginningLaneSet(this, m_mapAssetPool, m_highestRowCoord, OnNewLaneCreated); m_currentLaneSet.CreateLanes(m_activeLaneCount - m_highestRowCoord + m_startRowCoord); // Fill up the screen with random sets FillUpMap(m_activeLaneCount - m_highestRowCoord + m_lowestRowCoord); }