Пример #1
0
        public BaseLevel()
        {
            //declaring positions
            directionGaugePosition    = new Vector2(125f, SacreBleuGame._instance._screenHeight - 50f);
            powerBarPosition          = new Vector2(SacreBleuGame._instance._screenWidth - 75f, SacreBleuGame._instance._screenHeight - 75f);
            buttonPosition            = new Vector2(SacreBleuGame._instance._screenWidth - 150f, SacreBleuGame._instance._screenHeight - 75f);
            counterPosition           = new Vector2(75f, SacreBleuGame._instance._screenHeight / 2 - (0.90f * SacreBleuGame._instance._screenHeight / 2));
            pauseMenuContinuePosition = new Vector2(SacreBleuGame._instance._screenWidth / 2, SacreBleuGame._instance._screenHeight / 2 - 50f);
            pauseMenuRestartPosition  = new Vector2(SacreBleuGame._instance._screenWidth / 2, SacreBleuGame._instance._screenHeight / 2);
            quitPosition = new Vector2(SacreBleuGame._instance._screenWidth / 2, SacreBleuGame._instance._screenHeight / 2 + 50f);
            wonScreenNextLevelPosition  = new Vector2(SacreBleuGame._instance._screenWidth / 2, SacreBleuGame._instance._screenHeight / 2 - 50f);
            wonScreenRetryLevelPosition = new Vector2(SacreBleuGame._instance._screenWidth / 2, SacreBleuGame._instance._screenHeight / 2);

            //setting positions
            _directionGauge           = new DirectionGauge(directionGaugePosition, SacreBleuGame._instance.arrowTexture);
            _powerBar                 = new PowerBar(powerBarPosition, SacreBleuGame._instance.powerBarTexture, SacreBleuGame._instance.basicSquare);
            _hitbutton                = new HitButton(buttonPosition, SacreBleuGame._instance.basicSquare, "hitButton");
            pauseMenuContinueButton   = new ButtonGameObject(pauseMenuContinuePosition, SacreBleuGame._instance.basicSquare, "continueButton");
            pauseMenuRestartButton    = new ButtonGameObject(pauseMenuRestartPosition, SacreBleuGame._instance.basicSquare, "restartButton");
            quitButton                = new ButtonGameObject(quitPosition, SacreBleuGame._instance.basicSquare, "quitButton");
            wonScreenNextLevelButton  = new ButtonGameObject(wonScreenNextLevelPosition, SacreBleuGame._instance.basicSquare, "nextLevelButton");
            wonScreenRetryLevelButton = new ButtonGameObject(wonScreenRetryLevelPosition, SacreBleuGame._instance.basicSquare, "retryLevelButton");

            //GenerateLevel(levelLayout);

            numberOfHits = 0;
            par          = 0;

            entities   = new List <GameObject>();
            bgEntities = new List <GameObject>();
        }
Пример #2
0
    private void UpdateGauge(AgentBehaviour p_agent, EDirection p_direction, float p_value)
    {
        DirectionGauge directionGauge = Gauges.Find(e => e.Direction == p_direction);

        directionGauge.Gauge.ChangeInfluence(p_value);
        p_agent.OnBeingEaten -= UpdateGauge;
    }