コード例 #1
0
ファイル: NodeManager.cs プロジェクト: kenvifire/ZumaDemo
        private static void InsertNode()
        {
            LinkedListNode <Ball> ballPos = ballList.Find(nodeBeingInserted);

            LinkedListNode <Ball> prev = ballPos.Previous;

            LinkedListNode <Ball> next = ballPos.Next;

            bool isTouching = false;

            if (prev != null && ballPos.Value.IsTouching(prev.Value))
            {
                MoveNode(MoveType.Backward, prev);
                isTouching = true;
            }

            if (next != null && ballPos.Value.IsTouching(next.Value))
            {
                MoveNode(MoveType.Forward, next);
                isTouching = true;
            }

            if (!isTouching)
            {
                CheckComb(nodeBeingInserted);
                GameStatusManager.Ready();
            }
        }
コード例 #2
0
ファイル: NodeManager.cs プロジェクト: kenvifire/ZumaDemo
        public static void DestroyBall(Ball ball)
        {
            switch (ball.role)
            {
            case BallRole.Bullet:
                ball.Destroy();
                GameStatusManager.Ready();
                break;

            case BallRole.Follower:
                ball.Destroy();
                break;
            }
        }