Пример #1
0
        public RogueskivRenderer(
            UxContext uxContext,
            IGameContext gameContext,
            RogueskivGame game,
            IRogueskivUxConfig uxConfig,
            IRogueskivGameConfig gameConfig
            ) : base(uxContext, game)
        {
            RogueskivGame      = game;
            UxContext          = uxContext;
            UxConfig           = uxConfig;
            PlayerPositionComp = game.Entities.GetSingleComponent <PlayerComp, CurrentPositionComp>();

            var font = uxContext.GetFont(uxConfig.FontFile, FONT_SIZE);

            BoardTexture = uxContext.GetTexture("board.png");

            var bgrRenderer = new BgrRenderer(uxContext, new Size(1920, 1440));

            Renderers.Add(bgrRenderer);
            Renderers.Add(new BoardRenderer(uxContext, game, BoardTexture));

            CompRenderers[typeof(FoodComp)]        = new FoodRenderer(this, uxContext, game, BoardTexture);
            CompRenderers[typeof(TorchComp)]       = new TorchRenderer(this, uxContext, game, BoardTexture);
            CompRenderers[typeof(MapRevealerComp)] = new MapRevealerRenderer(this, uxContext, game, BoardTexture);
            CompRenderers[typeof(AmuletComp)]      = new AmuletRenderer(this, uxContext, game, BoardTexture);
            CompRenderers[typeof(EnemyComp)]       = new EnemyRenderer(uxContext, game);
            CompRenderers[typeof(FOVComp)]         = new FOVRenderer(uxContext);
            CompRenderers[typeof(PlayerComp)]      = new PlayerRenderer(uxContext, game, gameConfig.PlayerRadius);
            CompRenderers[typeof(HealthComp)]      = new HealthRenderer(uxContext);
            CompRenderers[typeof(TimerComp)]       = new GameInfoRenderer(
                uxContext,
                gameContext,
                font,
                game.Floor,
                inGameTimeVisible: gameConfig.InGameTimeVisible,
                realTimeVisible: gameConfig.RealTimeVisible
                );
            CompRenderers[typeof(PopUpComp)] = new PopUpRenderer(uxContext, game, font);

            PlayerMovementEffectPlayer = new PlayerMovementEffectPlayer(uxContext, game);
            EffectPlayers.Add(new BounceEffectPlayer(uxContext, game));
            EffectPlayers.Add(new TorchPickedEffectPlayer(uxContext, game));
            EffectPlayers.Add(new MapRevealerPickedEffectPlayer(uxContext, game));
            EffectPlayers.Add(new FoodPickedEffectPlayer(uxContext, game));
            EffectPlayers.Add(new WinEffectPlayer(uxContext, game));
            EffectPlayers.Add(new EnemyCollidedEffectPlayer(uxContext, game));
            EffectPlayers.Add(new StairsUpEffectPlayer(uxContext, game));
            EffectPlayers.Add(new StairsDownEffectPlayer(uxContext, game));
            EffectPlayers.Add(new DeathEffectPlayer(uxContext, game));
        }
Пример #2
0
    // Use this for initialization
    void Start()
    {
        enemyRenderer = GetComponent <EnemyRenderer> ();
        if (enemyRenderer != null)
        {
            tierLogo.sprite = TierToLogo(enemyRenderer.enemy.tier);
        }

        allyRenderer = GetComponent <AllyRenderer> ();
        if (allyRenderer != null)
        {
            tierLogo.sprite = TierToLogo(allyRenderer.ally.strongAgainst[0]);
        }
    }