Example #1
0
        public Fruit RegisterFruit(ObjectNetID objectNetID, bool loadTexture = true)
        {
            Fruit f = new Fruit(_gameField.RandomPointInField(), _gameField, loadTexture);

            _gameField.Fruits.Add(f);

            return(f);
        }
Example #2
0
        //Eat the fruit
        public virtual void Eat(Fruit f)
        {
            Score++;

            //add to snake and change fruit's position
            _tail.Insert(0, new Point(Head.X, Head.Y));
            f.ResetPosition(_gameField.RandomPointInField());
        }
Example #3
0
 public void Eat(Fruit f)
 {
     _tail.Insert(0, new Point(Head.X, Head.Y));
     f.ResetPosition(_gameField.RandomPointInField());
 }