Пример #1
0
        private void Init()
        {
            boxDoorList = PointLists.boxDoorPointList();
            boxList     = PointLists.boxPointList();
            wallList    = PointLists.mapList(stage, '0');
            scaleList   = MazeList.WallList(stage);
            directionsInit();
            gState = GhostState.NORMAL;
            target = new Point();
            switch (color)
            {
            case GhostColor.BLUE:
                ghost = new Ghost(new Point(30, 28), Direction.UP);
                break;

            case GhostColor.PINK:
                ghost = new Ghost(new Point(26, 28), Direction.DOWN);
                break;

            case GhostColor.RED:
                ghost = new Ghost(new Point(26, 21), Direction.RIGHT);
                break;

            case GhostColor.YELLOW:
                ghost = new Ghost(new Point(22, 28), Direction.UP);
                break;
            }
            map          = new Map(scaleList);
            aStar        = new AStar(map);
            bestFirst    = new BestFirst(map);
            breadthFirst = new BreadthFirst(map);
            State        = GameState.GAMEOVER;
        }
Пример #2
0
        public void reset(int stage)
        {
            wallList     = PointLists.mapList(stage, '0');
            scaleList    = MazeList.WallList(stage);
            gState       = GhostState.NORMAL;
            map          = new Map(scaleList);
            aStar        = new AStar(map);
            bestFirst    = new BestFirst(map);
            breadthFirst = new BreadthFirst(map);
            switch (color)
            {
            case GhostColor.BLUE:
                ghost = new Ghost(new Point(30, 28), Direction.UP);
                break;

            case GhostColor.PINK:
                ghost = new Ghost(new Point(26, 28), Direction.DOWN);
                break;

            case GhostColor.RED:
                ghost = new Ghost(new Point(26, 21), Direction.RIGHT);
                break;

            case GhostColor.YELLOW:
                ghost = new Ghost(new Point(22, 28), Direction.UP);
                break;
            }
        }