示例#1
0
        public void createTube()
        {
            var newTube = new Tube(thatRandomPos);

            thatRandomPos = newTube.thisRandomPos;
            tubesList.Add(newTube);
        }
示例#2
0
        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();
            }
        }