Ejemplo n.º 1
0
    public bool DamageBlock(float damage)
    {
        Type.Contents.ReduceHealth(damage);
        if (Type.Contents.Health <= 0)
        {
            Type = new BS_Empty();

            return(false);
        }
        return(true);
    }
Ejemplo n.º 2
0
    private BlockState GetNewType(Point point)
    {
        BlockState returnType = new BS_Empty();

        if (sigmoidalInflectionPoint <= 0)
        {
            sigmoidalInflectionPoint = 1;
        }

        float sigmoidPoint = Sigmoid(point.x, sigmoidalInflectionPoint);

        float chanceToProduceSolidBlock = sigmoidPoint * blockChance;

        if (Random.Range(0f, 1f) < chanceToProduceSolidBlock)
        {
            returnType = new BS_Solid(GetNewContents());
        }

        return(returnType);
    }