注册 登录
编程论坛 数据结构与算法

时间复杂度空间复杂度计算

heye969 发布于 2010-05-28 19:43, 719 次点击
public bool GameOver
        {
            get
            {
                //游戏已结束
                if (gameOver)
                {
                    return true;
                }

                //如果蛇头碰到蛇身,或者蛇头越过的屏幕边界,则游戏结束
                if (snake.IsHeadTouchedBody() ||
                    snake.Head.X < 0 || snake.Head.X > width ||
                    snake.Head.Y < 0 || snake.Head.Y > height)
                {
                    gameOver = true;
                    return true;
                }
                return false;
            }
        }
最好有详细过程
0 回复
1