コード例 #1
0
ファイル: GhostRun.cs プロジェクト: Mihqas/PacmanWinForms
        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
ファイル: GhostRun.cs プロジェクト: Mihqas/PacmanWinForms
        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;
            }
        }