Exemplo n.º 1
0
        public bool IsEaten(List <Point> snake)
        {
            Point head = snake.Last();

            if (_map.CheckCollisions(head))
            {
                _map.Score += 10;
                return(true);
            }

            return(false);
        }
Exemplo n.º 2
0
        public void Move()
        {
            Point tail = _snake.First();

            _snake.Remove(tail);

            Point head = GetNextPoint();

            _snake.Add(head);

            if (_map.CheckCollisions(head))
            {
                IsAlive = false;
            }

            _map.Remove(tail);
            tail.Clear();

            _map.Place(head);
            head.Draw();
        }