예제 #1
0
        // drawSprite max 7 fruit from max level 21
        async ValueTask drawFruit(CanvasWrapper ds)
        {
            if (_gameStats.IsDemo)
            {
                return;
            }

            var highestLevel = Math.Min(
                20,
                _gameStats.CurrentPlayerStats.LevelStats.LevelNumber);

            var lowestLevel = Math.Max(
                0,
                highestLevel - 6);

            var x = 204;

            // starting from the right
            for (var i = lowestLevel; i <= highestLevel; i++, x -= 16)
            {
                var item = LevelStats.GetLevelProps(i).Fruit;

                _fruit.SetFruitItem(item);
                _fruit.Position = new Vector2(x, 10);


                await ds.DrawSprite(_fruit, Spritesheet.Reference);
            }
        }
예제 #2
0
        public void PacManEaten()
        {
            _ghostHouseDoor.SwitchToUseGlobalCounter();

            var props = LevelStats.GetGhostPatternProperties();

            _ghostMovementConductor = new GhostMovementConductor(props);
        }
예제 #3
0
        public void NewLevel()
        {
            _levelStats     = new LevelStats(++_levelNumber);
            _ghostHouseDoor = new GhostHouseDoor(0, _mediator);

            var props = LevelStats.GetGhostPatternProperties();

            _ghostMovementConductor = new GhostMovementConductor(props);
        }
예제 #4
0
        public PlayerStats(int playerIndex, IMediator mediator)
        {
            _mediator   = mediator;
            PlayerIndex = playerIndex;

            Score = 0;

            //cheat
            LivesRemaining = Constants.PacManLives;
            _levelNumber   = -1;

            _extraLives = new List <int> {
                10000
            };
            _levelStats     = new LevelStats(0);
            _ghostHouseDoor = new GhostHouseDoor(0, _mediator);

            var props = LevelStats.GetGhostPatternProperties();

            _ghostMovementConductor = new GhostMovementConductor(props);
        }