Beispiel #1
0
        public BigPacChaseAct(IMediator mediator, IGameSoundPlayer gameSoundPlayer)
        {
            _mediator        = mediator;
            _gameSoundPlayer = gameSoundPlayer;
            _finished        = false;

            var justOffScreen = new Vector2(250, 140);

            _blinkyTimer = new EggTimer(4500.Milliseconds(), reverseChase);

            _pacTimer = new EggTimer(4750.Milliseconds(), () => { });

            _pacMan = new AttractScenePacMan {
                Direction = Directions.Left
            };

            _bigPacMan = new GeneralSprite(Vector2.Zero,
                                           new Size(31, 32),
                                           new Vector2(16, 16),
                                           new Vector2(488, 16),
                                           new Vector2(520, 16),
                                           110.Milliseconds())
            {
                Visible = false
            };


            _blinky = new AttractGhost(GhostNickname.Blinky, Directions.Left);

            _pacPositions = new StartAndEndPos(justOffScreen, new Vector2(-70, justOffScreen.Y));

            _blinkyPositions = new StartAndEndPos(justOffScreen + new Vector2(20, 0), new Vector2(-40, justOffScreen.Y));
        }
Beispiel #2
0
        public GhostTearAct(IGameSoundPlayer gameSoundPlayer, IMediator mediator)
        {
            _gameSoundPlayer = gameSoundPlayer;
            _mediator        = mediator;

            _finished = false;
            //NextAct = nextAct;
            _stage     = Stage.MovingBlinky;
            _animFrame = 0;

            _tearFrames = new[]
            {
                new Vector2(589, 98),
                new Vector2(609, 98),
                new Vector2(622, 98),
                new Vector2(636, 98),
                new Vector2(636, 98),
                new Vector2(636, 98),
                new Vector2(649, 98)
            };

            _blinkyLookFrames = new[] {
                new Vector2(584, 113),
                new Vector2(600, 113)
            };

            _blinkyTimer = new EggTimer(4500.Milliseconds(), blinkyCaught);

            _tearTimer = new LoopingTimer(500.Milliseconds(),
                                          () => {
                if (_stage == Stage.TearingBlinky)
                {
                    updateTearAnimation();
                }
            });

            _lookTimer = new LoopingTimer(TimeSpan.MaxValue, () => { });

            _pacTimer = new EggTimer(4750.Milliseconds(), () => { });

            _pacMan = new AttractScenePacMan
            {
                Direction = Directions.Left
            };

            _snagSprite = new GeneralSprite(_centerPoint, _tearSize, _tearOffset, _tearFrames[0])
            {
                Visible = true
            };

            _blinky        = new AttractGhost(GhostNickname.Blinky, Directions.Left);
            _lookingBlinky = new NullSprite();

            var justOffScreen = new Vector2(250, 140);

            _pacPositions = new StartAndEndPos(justOffScreen, new Vector2(-70, justOffScreen.Y));

            _blinkyPositions = new StartAndEndPos(justOffScreen + new Vector2(120, 0), _centerPoint - new Vector2(10, 0));
        }
Beispiel #3
0
        public TornGhostChaseAct(IMediator mediator, IGameSoundPlayer gameSoundPlayer)
        {
            _mediator        = mediator;
            _gameSoundPlayer = gameSoundPlayer;
            _finished        = false;

            var justOffScreen = new Vector2(250, 140);

            _ghostTimer = new EggTimer(4500.Milliseconds(), reverseChase);

            _pacTimer = new EggTimer(4800.Milliseconds(), () => { });

            _pacMan = new AttractScenePacMan
            {
                Direction = Directions.Left
            };

            _worm = new GeneralSprite(Vector2.Zero,
                                      new Size(22, 11),
                                      new Vector2(11, 5.5f),
                                      new Vector2(594, 132),
                                      new Vector2(626, 132),
                                      110.Milliseconds())
            {
                Visible = false
            };


            _blinky = new GeneralSprite(Vector2.Zero,
                                        new Size(14, 14),
                                        new Vector2(7.5f, 7.5f),
                                        new Vector2(618, 113),
                                        new Vector2(634, 113),
                                        110.Milliseconds());


            _pacPositions = new StartAndEndPos(justOffScreen, new Vector2(-70, justOffScreen.Y));

            _ghostStartAndEndPos = new StartAndEndPos(justOffScreen + new Vector2(50, 0), new Vector2(-40, justOffScreen.Y));
        }
Beispiel #4
0
        public ChaseSubAct()
        {
            _finished   = false;
            _tempTimers = new TimerList();

            _ghostScore = 200;

            _tempSprites = new TimedSpriteList();
            _ghosts      = new List <AttractGhost>();

            var justOffScreen = new Vector2(250, 140);

            _ghostEatenTimer = new EggTimer(0.Milliseconds(), () => { });
            _ghostTimer      = new EggTimer(5.Seconds(), async() => await reverseChase());
            _pacTimer        = new EggTimer(5.1f.Seconds(), () => { });

            _powerPillToEat = new PowerPill
            {
                Visible  = false,
                Position = new Vector2(30, justOffScreen.Y - 4)
            };

            _pillLegend = new Pill {
                Position = new Vector2(70, 178)
            };

            _powerPillLegend = new PowerPill {
                Position = new Vector2(66, 182)
            };

            _pacMan = new AttractScenePacMan {
                Direction = Directions.Left
            };

            var blinky = new AttractGhost(GhostNickname.Blinky, Directions.Left);
            var pinky  = new AttractGhost(GhostNickname.Pinky, Directions.Left);
            var inky   = new AttractGhost(GhostNickname.Inky, Directions.Left);
            var clyde  = new AttractGhost(GhostNickname.Clyde, Directions.Left);

            _ghosts.Add(blinky);
            _ghosts.Add(pinky);
            _ghosts.Add(inky);
            _ghosts.Add(clyde);

            var gap = new Vector2(16, 0);

            _pacPositions    = new StartAndEndPos(justOffScreen, new Vector2(30, justOffScreen.Y));
            _pacMan.Position = _pacPositions.Start;

            _ghostPositions = new Dictionary <GhostNickname, StartAndEndPos>();

            var startPos = justOffScreen + new Vector2(50, 0);
            var endPos   = new Vector2(50, justOffScreen.Y);

            blinky.Position = startPos;
            _ghostPositions[blinky.NickName] = new StartAndEndPos(startPos, endPos);

            startPos       = startPos + gap;
            endPos         = endPos + gap;
            pinky.Position = startPos;
            _ghostPositions[pinky.NickName] = new StartAndEndPos(startPos, endPos);

            startPos      = startPos + gap;
            endPos        = endPos + gap;
            inky.Position = startPos;
            _ghostPositions[inky.NickName] = new StartAndEndPos(startPos, endPos);

            startPos       = startPos + gap;
            endPos         = endPos + gap;
            clyde.Position = startPos;
            _ghostPositions[clyde.NickName] = new StartAndEndPos(startPos, endPos);

            _tempTimers.Add(new EggTimer(1.Seconds(), () => _legendVisible = true));
            _tempTimers.Add(new EggTimer(3.Seconds(), () =>
            {
                _powerPillToEat.Visible = true;
                _copyrightVisible       = true;
            }));

            _tempTimers.Add(new EggTimer(4500.Milliseconds(), () =>
            {
                _ghostsChasing = true;
            }));
        }