예제 #1
0
    // Update is called once per frame
    void Update()
    {
        if (isCameraMoving)
        {
            return;
        }
        RaycastHit hit;

        if (Physics.Raycast(this.transform.position, Vector3.right, out hit, 3))
        {
            if (hit.collider.CompareTag("Blockage"))
            {
                stats.ChangeLives(-1);
                blockManager.ActivateAll();
            }
        }
        this.transform.Translate(shipVelocity * shipAcceleration * Time.deltaTime, 0, 0);
        score     += Mathf.RoundToInt(shipVelocity * scoreIncreaseRate * Time.deltaTime);
        Score.text = score.ToString();
        Speed.text = (shipVelocity * 10.0f).ToString();
    }