示例#1
0
        private void CreateFood()
        {
            Point location = new Point(random.Next(arenaSize.Width) / 10 * 10, random.Next(arenaSize.Height) / 10 * 10);
            Food  newfood  = new Food(location, this);

            Foods.Add(newfood);

            // 场上不止一种食物?
            if (Foods.Count > 1)
            {
                Foods.RemoveAt(0);
            }
        }