Example #1
0
    void Update()
    {
        deltaTime += Time.deltaTime;

        if (deltaTime > 0.013f)
        {
            if (!pause)
            {
                float locationX     = transform.localPosition.x;
                float blackHolePull = space.blackHolePull;
                if (transform.localPosition.x > -3.2f)
                {
                    if (blackHolePull == 0.0f)
                    {
                        transform.localPosition -= new Vector3(enemySpeed * (deltaTime / 0.013f), 0.0f, 0.0f);
                    }
                    else
                    {
                        if (locationX < 1.9f)
                        {
                            transform.localPosition -= new Vector3((enemySpeed - (blackHolePull * 0.35f)) * (deltaTime / 0.013f), 0.0f, 0.0f);
                        }
                        else
                        {
                            transform.localPosition -= new Vector3(enemySpeed * (deltaTime / 0.013f), 0.0f, 0.0f);
                        }
                    }
                }
                else
                {
                    space.ChangeNumberOfEnemies(-10);
                    PushOnStack();
                }
            }
            deltaTime = 0.0f;
        }
    }