예제 #1
0
        void reverseChase()
        {
            _blinkyTimer = new EggTimer(4600.Milliseconds(), () => { });

            _pacTimer = new EggTimer(4350.Milliseconds(), async() =>
            {
                _finished = true;
                await _mediator.Publish(new CutSceneFinishedEvent());
            });

            _pacMan.Visible    = false;
            _bigPacMan.Visible = true;

            var s    = new LevelStats(0);
            var sess = new GhostFrightSession(s.GetLevelProps());

            _blinky.Direction = new DirectionInfo(Directions.Right, Directions.Right);
            _blinky.SetFrightSession(sess);
            _blinky.SetFrightened();
            _blinkyPositions = _blinkyPositions.Reverse();

            var bigPacPos = _pacPositions.Reverse();

            bigPacPos = new StartAndEndPos(bigPacPos.Start - new Vector2(100, 0), bigPacPos.End);

            _pacPositions = bigPacPos;
        }
예제 #2
0
// we are reading these properties:
// elroy1DotsLeft
// elroy1SpeedPc
// elroy2DotsLeft
// elroy2SpeedPc

        protected override float GetNormalGhostSpeedPercent()
        {
            LevelStats levelStats = CurrentPlayerStats.LevelStats;

            LevelProps levelProps = levelStats.GetLevelProps();

            int pillsRemaining = levelStats.PillsRemaining;

            if (pillsRemaining > levelProps.Elroy1DotsLeft)
            {
                return(levelProps.GhostSpeedPc);
            }

            if (pillsRemaining < levelProps.Elroy2DotsLeft)
            {
                return(levelProps.Elroy2SpeedPc);
            }

            return(levelProps.Elroy1SpeedPc);
        }
예제 #3
0
        ValueTask reverseChase()
        {
            _powerPillToEat.Visible = false;
            _ghostTimer             = new EggTimer(12.Seconds(), () => { });
            _pacTimer = new EggTimer(6.Seconds(), () => { });

            var levelStats     = new LevelStats(0);
            var frightSessions = new GhostFrightSession(levelStats.GetLevelProps());

            foreach (var eachGhost in _ghosts)
            {
                eachGhost.Direction.Update(Directions.Right);
                eachGhost.SetFrightSession(frightSessions);
                eachGhost.SetFrightened();

                _ghostPositions[eachGhost.NickName] = _ghostPositions[eachGhost.NickName].Reverse();
            }

            _pacPositions = _pacPositions.Reverse();

            _pacMan.Direction = Directions.Right;

            return(default);
예제 #4
0
    public async ValueTask FruitEaten()
    {
        await IncreaseScoreBy(_levelStats.GetLevelProps().FruitPoints);

        LevelStats.FruitSession.FruitEaten();
    }