Ejemplo n.º 1
0
 void Awake()
 {
     if (introcutscene != null)
     {
         Destroy(gameObject);
     }
     else
     {
         introcutscene = this;
     }
 }
Ejemplo n.º 2
0
        public LevelProps(
            IntroCutScene introCutScene,

            FruitItem fruit,
            int fruitPoints,

            float pacManSpeedPc,
            float pacManDotsSpeedPc,

            float ghostSpeedPc,
            float ghostTunnelSpeedPc,

            int elroy1DotsLeft,
            float elroy1SpeedPc,
            int elroy2DotsLeft,
            float elroy2SpeedPc,

            float frightPacManSpeedPc,
            float frightPacManDotSpeedPc,

            float frightGhostSpeedPc,
            int frightGhostTime,
            int frightGhostFlashes)
        {
            IntroCutScene          = introCutScene;
            Fruit                  = fruit;
            FruitPoints            = fruitPoints;
            PacManSpeedPc          = pacManSpeedPc;
            PacManDotsSpeedPc      = pacManDotsSpeedPc;
            GhostSpeedPc           = ghostSpeedPc;
            GhostTunnelSpeedPc     = ghostTunnelSpeedPc;
            Elroy1DotsLeft         = elroy1DotsLeft;
            Elroy1SpeedPc          = elroy1SpeedPc;
            Elroy2DotsLeft         = elroy2DotsLeft;
            Elroy2SpeedPc          = elroy2SpeedPc;
            FrightPacManSpeedPc    = frightPacManSpeedPc;
            FrightPacManDotSpeedPc = frightPacManDotSpeedPc;
            FrightGhostSpeedPc     = frightGhostSpeedPc;
            FrightGhostTime        = frightGhostTime;
            FrightGhostFlashes     = frightGhostFlashes;
        }
Ejemplo n.º 3
0
            public async Task Handle(LevelFinishedEvent notification, CancellationToken cancellationToken)
            {
                try
                {
                    PlayerStats playerStats = _gameStats.CurrentPlayerStats;

                    var maze = _mazeCanvases.GetForPlayer(playerStats.PlayerIndex);

                    await maze.Reset();

                    _gameStats.LevelFinished();

                    IntroCutScene cutScene = playerStats.LevelStats.GetLevelProps().IntroCutScene;

                    if (cutScene == IntroCutScene.None)
                    {
                        await _mediator.Publish(new PlayerStartingEvent(), cancellationToken);

                        return;
                    }

                    var act = cutScene switch
                    {
                        IntroCutScene.BigPac => await getAct("BigPacChaseAct"),
                        IntroCutScene.GhostSnagged => await getAct("GhostTearAct"),
                        IntroCutScene.TornGhostAndWorm => await getAct("TornGhostChaseAct"),
                        // ReSharper disable once HeapView.BoxingAllocation
                        _ => throw new InvalidOperationException($"Don't know how to handle cut scene of {cutScene}")
                    };

                    await act.Reset();

                    _game.SetAct(act);
                }
                catch (Exception e)
                {
                    Console.WriteLine(e);
                    throw;
                }
            }