예제 #1
0
    public override void notify()
    {
        textCollider2d.Text = Mathf.Ceil(time.TimeLeft) + "";

        if (wentNegative)
        {
            if (time.TimeLeft >= 10)
            {
                wentNegative = false;
                if (!flashEffect.isDone)
                {
                    flashEffect.isDone = true;
                }
                textCollider2d.Color = GameConstantes.instance.currentTheme.instructionColor;
                textCollider2d.Color = Color.magenta;
            }
        }
        else
        {
            if (time.TimeLeft < 10)
            {
                wentNegative = true;
                flashEffect  = GameConstantes.instance.currentTheme.createTimeGoingUnder10Gradient(textCollider2d);
                EffectManager.AddGameEffect(flashEffect);
            }
        }
    }
예제 #2
0
    public void flashCompileEffect()
    {
        TextCollider2D instructionTC = this.GetComponent <TextCollider2D> ();
        Effect         effect        = GameConstantes.instance.currentTheme.createInstructionFlashEffect(instructionTC, true);

        EffectManager.AddGameEffect(effect);
    }
예제 #3
0
    void OnTriggerEnter2D(Collider2D other)
    {
        Parameter param = other.GetComponent <Parameter>();

        if (param != null && param.canBeChanged)
        {
            Effect e = GameConstantes.instance.currentTheme.createParameterHighlightEffect(param);
            EffectManager.AddGameEffect(e);
            this.collidedParameter = param;
        }
    }
예제 #4
0
 bool IDeletable.Delete(Spike spike)
 {
     if (!invulnerable)
     {
         int spikeX  = (int)spike.transform.position.x;
         int parentX = (int)this.transform.position.x;
         int x       = spikeX - parentX;
         EffectManager.AddGameEffect(new SplitTextEffect(this.GetComponent <TextCollider2D>(), x));
     }
     return(!invulnerable);
 }
예제 #5
0
    public override IEnumerator Initialize()
    {
        yield return(new WaitForSeconds(0));

        initialized = true;

        if (spikeManager != null)
        {
            transform.position = spikeManager.transform.position + new Vector3(0, 2, 0);
            colorEffect        = new ColorChangeEffect(textCollider2D, textCollider2D.Color, new Color(textCollider2D.Color.r, textCollider2D.Color.g, textCollider2D.Color.b, 1), 2);
            EffectManager.AddGameEffect(colorEffect);
            moveEffect = new MoveEffect(textCollider2D, spikeManager.transform.position, 2, true);
            EffectManager.AddGameEffect(moveEffect);
        }
    }
예제 #6
0
파일: Dragger.cs 프로젝트: Dracir/semicolon
    void swap(Parameter hitedParameter, Parameter parameterDragged)
    {
        if (!hitedParameter.isSameType(parameterDragged))
        {
            return;
        }
        TextCollider2D textColliderHited  = hitedParameter.GetComponent <TextCollider2D>();
        TextCollider2D textColliderInDrag = parameterDragged.GetComponent <TextCollider2D>();
        Color          c1t1 = textColliderHited.Color;
        Color          c1t0 = new Color(c1t1.r, c1t1.g, c1t1.b, 0);
        Color          c2t1 = textColliderInDrag.Color;
        Color          c2t0 = new Color(c1t1.r, c1t1.g, c1t1.b, 0);

        EffectManager.AddGameEffect(new ColorChangeEffect(textColliderHited, c1t0, c1t1, GameConstantes.instance.currentTheme.timeOnInstructionSwap));
        EffectManager.AddGameEffect(new ColorChangeEffect(textColliderInDrag, c2t0, c2t1, GameConstantes.instance.currentTheme.timeOnInstructionSwap));

        hitedParameter.swapWith(parameterDragged);
    }
예제 #7
0
    void swap(Parameter hitedParameter, Parameter parameterDragged)
    {
        if (!hitedParameter.isSameType(parameterDragged))
        {
            AudioPlayer.Play("Synth_Impact_Static_7");             // Player tries an invalid variable swap
            return;
        }

        AudioPlayer.Play("Voice_Impact_Down_1");         // Player successfuly swaps variables

        TextCollider2D textColliderHited  = hitedParameter.GetComponent <TextCollider2D>();
        TextCollider2D textColliderInDrag = parameterDragged.GetComponent <TextCollider2D>();
        Color          c1t1 = textColliderHited.Color;
        Color          c1t0 = new Color(c1t1.r, c1t1.g, c1t1.b, 0);
        Color          c2t1 = textColliderInDrag.Color;
        Color          c2t0 = new Color(c1t1.r, c1t1.g, c1t1.b, 0);

        EffectManager.AddGameEffect(new ColorChangeEffect(textColliderHited, c1t0, c1t1, GameConstantes.instance.currentTheme.timeOnInstructionSwap));
        EffectManager.AddGameEffect(new ColorChangeEffect(textColliderInDrag, c2t0, c2t1, GameConstantes.instance.currentTheme.timeOnInstructionSwap));

        hitedParameter.swapWith(parameterDragged);
    }