Exemplo n.º 1
0
 void Awake()
 {
     current = 0;
     smu     = GetComponent <SimultaneousUpdater>();
     cm      = GetComponent <CoinMultiplier>();
     scl     = timerBar.GetComponent <BasicImageScalar>();
 }
Exemplo n.º 2
0
    public void Die()
    {
        //add coins to player
        GameObject coins = (GameObject)Instantiate(Resources.Load("CoinDrop"));

        // position
        coins.transform.position = transform.position;
        // coins
        coins.GetComponent <CoinComponent>().Coins = goldDrop;

        dead = true;
        // Die sound
        eac.PlayDie();

        // boom
        Destroy(gameObject);

        // Increment multiplier.
        GameObject controller = GameObject.FindGameObjectsWithTag("Controller")[0];

        if (controller != null)
        {
            CoinMultiplier cm = controller.GetComponent <CoinMultiplier>();
            cm.AddMult();
        }
    }
Exemplo n.º 3
0
 // Use this for initialization
 void Awake()
 {
     gm        = GetComponent <GridMovement>();
     smu       = updater.GetComponent <SimultaneousUpdater>();
     wt        = updater.GetComponent <WorldTimer>();
     pcc       = GetComponent <PlayerCoinController>();
     wcm       = updater.GetComponent <CoinMultiplier>();
     gst       = GetComponentInChildren <GridSpriteTranslate>();
     anim      = body.GetComponent <Animator>();
     anim_head = head.GetComponent <Animator>();
     eac       = GetComponent <EntityAudioController>();
 }
Exemplo n.º 4
0
    public void DealDamage(int dmg)
    {
        // Recalculate health and UI
        health -= dmg;
        redrawUIHearts();
        eac.PlayHurt();

        if (health <= 0)
        {
            loseGame();
        }

        GameObject controller = GameObject.FindGameObjectsWithTag("Controller")[0];

        if (controller != null)
        {
            CoinMultiplier cm = controller.GetComponent <CoinMultiplier>();
            cm.Reset();
        }
    }