예제 #1
0
    private void DoAtmosphereEffects(float delta)
    {
        Atmosphere atmosphere = (Atmosphere)(Body.GetTree().GetRoot().GetNode(Game.ATMOSPHERE_PATH));

        if (!(atmosphere.GetGasProgress(Gas.OXYGEN) > oxygenThreshold && atmosphere.GetGasProgress(Gas.CARBON_DIOXIDE) > co2Threshold))
        {
            Kill();
        }
        else
        {
            atmosphere.SetGasAmt(Gas.CARBON_DIOXIDE, atmosphere.GetGasAmt(Gas.CARBON_DIOXIDE) + co2Production * delta);
            atmosphere.SetGasAmt(Gas.OXYGEN, atmosphere.GetGasAmt(Gas.OXYGEN) + -oxygenConsumption * delta);
        }
    }