public void CreateInitialGaps() { LevelGap gap = new LevelGap(Direction.Left, new Vector2(50, 1), creator.Config); LevelGap gap1 = new LevelGap(Direction.Right, new Vector2(50, 1), creator.Config); Gaps.Add(gap); Gaps.Add(gap1); }
public void DrawGap(LevelGap levelGap) { for (int i = 0; i < levelGap.Gap.GapUnits.Length; i++) { int x = (int)levelGap.Gap.GapUnits[i].x; int y = (int)levelGap.Gap.GapUnits[i].y; Lines[y].Units[x].SetActive(false); } }
public void CreateRandomGap() { if (Gaps.Count < creator.Config.MaxGaps) { int dir = 1; if (extraGaps > 3) { dir = 0; } int x = Random.Range(0, 80); int y = Random.Range(0, creator.Config.Lines); Debug.Log(string.Format("Creating gap at X:{0} Y:{1}", x, y)); LevelGap gap = new LevelGap((Direction)dir, new Vector2(x, y), creator.Config); Gaps.Add(gap); extraGaps++; } else { Debug.Log("Max gaps"); } }