public void createTube() { var newTube = new Tube(thatRandomPos); thatRandomPos = newTube.thisRandomPos; tubesList.Add(newTube); }
public void update() { bird.update(); if (!gameOver) { Tube destrucTube = null; foreach (var tubeN in tubesList) { if (tubeN.x <= -150) // destruction tubes behind the window { destrucTube = tubeN; } tubeN.update(); } tubesList.Remove(destrucTube); checkedTubes.Remove(destrucTube); checkForGaming(); checkForCounting(); checkForRing(); checkForStar(); } }