예제 #1
0
        private void GameLost()
        {
            blinky = new GhostBlinky();
            pinky  = new GhostPinky();
            clyde  = new GhostClyde();
            inky   = new GhostInky();

            _pacman.isMoving = false;

            IsGameStarted = false;

            Dispose();

            hub.Clients.Clients(clients).SendAsync("GameLost", score.coin_sum + score.sum_bonus_coin, UserName);
        }
예제 #2
0
        internal Task StartNewGame()
        {
            blinky = new GhostBlinky();
            pinky  = new GhostPinky();
            clyde  = new GhostClyde();
            inky   = new GhostInky();

            _pacman.isMoving   = false;
            _pacman.position_x = 1;
            _pacman.position_y = 1;
            _pacman.move_X     = 0;
            _pacman.move_Y     = 1;

            level                = 1;
            _pacman.lifes        = 3;
            score.coin_sum       = 0;
            score.game_finish    = 0;
            score.sum_bonus_coin = 0;

            CountDown();

            eated_coin.Clear();
            eated_energizer.Clear();

            _pacman.isMoving = true;
            PacmanTimer.Change(0, 100);
            InkyTimer.Change(0, 120);
            ClydeTimer.Change(0, 120);
            PinkyTimer.Change(0, 120);
            BlinkyTimer.Change(0, 120);

            blinky.StartMoving();


            _gameMap.RestorMap();


            return(Task.CompletedTask);
        }
예제 #3
0
        private void NextLevel()
        {
            blinky = new GhostBlinky();
            pinky  = new GhostPinky();
            clyde  = new GhostClyde();
            inky   = new GhostInky();

            _pacman.isMoving   = false;
            _pacman.position_x = 1;
            _pacman.position_y = 1;
            _pacman.move_X     = 0;
            _pacman.move_Y     = 1;

            _pacman.lifes++;
            level++;
            score.game_finish = 0;

            CountDown();

            eated_coin.Clear();
            eated_energizer.Clear();

            _pacman.isMoving = true;
            PacmanTimer.Change(0, 100);
            InkyTimer.Change(0, 120);
            ClydeTimer.Change(0, 120);
            PinkyTimer.Change(0, 120);
            BlinkyTimer.Change(0, 120);

            blinky.StartMoving();

            score.ghost_start = 0;


            _gameMap.RestorMap();
        }