예제 #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)
 {
     boxDoorList = PointLists.boxDoorPointList();
     wallList    = PointLists.mapList(stage, '0');
     fruitState  = FruitState.NORMAL;
     fruit       = (stage == 1) ? new Fruit(new Point(26, 33), Direction.RIGHT) : new Fruit(new Point(26, 33), Direction.LEFT);
 }
예제 #3
0
        private void Init()
        {
            boxDoorList = PointLists.boxDoorPointList();
            wallList    = PointLists.banPointList();
            boxList     = PointLists.boxPointList();
            directionsInit();

            switch (color)
            {
            case GhostColor.BLUE:
                ghost = new Ghost(new Point(31, 29), Direction.UP);
                break;

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

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

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

            State = GameState.GAMEOVER;
        }
예제 #4
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;
            }
        }
예제 #5
0
파일: Packman.cs 프로젝트: ldh906/Pacman
 private void Init()
 {
     boxDoorList = PointLists.boxDoorPointList();
     wallList    = PointLists.banPointList();
     pacman      = new Pacman(new Point(27, 40), pacmanDirection);
     directionsInit();
     State = GameState.GAMEOVER;
 }
예제 #6
0
 private void Init()
 {
     boxDoorList = PointLists.boxDoorPointList();
     wallList    = PointLists.mapList(stage, '0');
     directionsInit();
     fruitState = FruitState.NORMAL;
     fruit      = (stage == 1) ? new Fruit(new Point(26, 33), Direction.RIGHT) : new Fruit(new Point(26, 33), Direction.LEFT);
     State      = GameState.GAMEOVER;
 }
예제 #7
0
 public void Run(int fruitIndex, int stage)
 {
     this.stage      = stage;
     State           = GameState.GAMERUN;
     wallList        = PointLists.mapList(stage, '0');
     fruitState      = FruitState.NORMAL;
     fruit           = (stage == 1) ? new Fruit(new Point(26, 33), Direction.RIGHT) : new Fruit(new Point(26, 33), Direction.LEFT);
     fruitRunner     = new Task(runfruit);
     this.fruitIndex = fruitIndex;
     fruitRunner.Start();
 }
예제 #8
0
 private void CheckReset()
 {
     if (reset)
     {
         board.Clear();
         wallList  = PointLists.mapList(stage, '0');
         dotList   = PointLists.mapList(stage, '2');
         bonusList = PointLists.mapList(stage, '8');
         RePaint();
         reset = false;
     }
 }
예제 #9
0
파일: PacmanGame.cs 프로젝트: ldh906/Pacman
        private void Init()
        {
            wallList    = PointLists.banPointList();
            dotList     = PointLists.dotPointList();
            boxList     = PointLists.boxPointList();
            boxDoorList = PointLists.boxDoorPointList();
            bonusList   = PointLists.bonusPointList();

            State = GameState.GAMEOVER;

            score       = 0;
            PacmanDelay = 70;
        }
예제 #10
0
 private void Init()
 {
     wallList         = PointLists.mapList(stage, '0');
     dotList          = PointLists.mapList(stage, '2');
     boxList          = PointLists.boxPointList();
     boxDoorList      = PointLists.boxDoorPointList();
     bonusList        = PointLists.mapList(stage, '8');
     fruit.fruitState = FruitState.EATEN;
     State            = GameState.GAMEOVER;
     AIFlagInit();
     score       = 0;
     PacmanDelay = stockPacmanDelay;
     GhostDelay  = stockGhostDelay;
 }
예제 #11
0
 private void checkForWin()
 {
     if (dotList.Count == 0 && bonusList.Count == 0)
     {
         parentForm.playSound(Properties.Resources.Pacman_Intermission);
         State = GameState.GAMEWAIT;
         WaitSomeTime(2500);
         while (wait)
         {
         }
         wait      = true;
         dotList   = PointLists.mapList(stage, '2');
         bonusList = PointLists.mapList(stage, '8');
         NextLevel();
         AIClockCounter = 0;
         SetGameRun(2000);
     }
 }
예제 #12
0
        public void reset(int stage)
        {
            this.stage = stage;
            board.ClearPacMan(pacman.Point);
            wallList = PointLists.mapList(stage, '0');
            switch (stage)
            {
            case 1:
                pacman = new Pacman(new Point(26, 39), Direction.STOP);
                break;

            case 2:
                pacman = new Pacman(new Point(26, 45), Direction.STOP);
                break;

            default:
                break;
            }
            pacmanNextDirection = Direction.STOP;
        }
예제 #13
0
        private void Init()
        {
            boxDoorList = PointLists.boxDoorPointList();
            wallList    = PointLists.mapList(stage, '0');
            switch (stage)
            {
            case 1:
                pacman = new Pacman(new Point(26, 39), Direction.STOP);
                break;

            case 2:
                pacman = new Pacman(new Point(26, 45), Direction.STOP);
                break;

            default:
                break;
            }
            directionsInit();
            State = GameState.GAMEOVER;
        }