예제 #1
0
파일: Hero.cs 프로젝트: GitMaiter/Snake
        internal void MoveHero()
        {
            Point tailPoint = pointList.First(); // return first list element

            pointList.Remove(tailPoint);         // delete last point it snake
            Point headPoint = GetNextPoint();

            pointList.Add(headPoint);

            tailPoint.ClearPoint();
            headPoint.DrawPoint();
        }
예제 #2
0
파일: Snake.cs 프로젝트: xprofession/Snake
        internal void Move()
        {
            Point tail = pList.First();

            pList.Remove(tail);
            Point head = GetNextPoint();

            pList.Add(head);

            tail.ClearPoint();
            head.DrawPoint();

            if (direction == Direction.Up || direction == Direction.Down)
            {
                Thread.Sleep(speedVertical);
            }
            else
            {
                Thread.Sleep(speedHorizontal);
            }
        }