예제 #1
0
파일: menu.cs 프로젝트: parth-p/Flappy-Bird
 void Update()
 {
     if (Input.GetKey(KeyCode.Space) || Input.GetMouseButtonDown(0))
     {
         Destroy(gameObject);
         GameObject bird         = GameObject.Find("Blue_Bird3");
         birdMove   targetScript = bird.GetComponent <birdMove>();
         targetScript.start = true;
     }
 }
예제 #2
0
    // Update is called once per frame
    void Update()
    {
        GameObject bird         = GameObject.Find("Blue_Bird3");
        birdMove   targetScript = bird.GetComponent <birdMove>();

        start1 = targetScript.start;

        if (start1)
        {
            Vector3 coord = transform.position;
            coord.z            = 0;
            transform.position = coord;
        }
    }
예제 #3
0
    // Update is called once per frame
    void Update()
    {
        if (!dead1)
        {
            Vector3 pos = transform.position;
            pos.x -= 0.1f;
            transform.position = pos;

            if (transform.position.x <= -13)
            {
                Vector3 pos1 = transform.position;
                pos1.x             = 13;
                transform.position = pos1;
            }
            GameObject bird         = GameObject.Find("Blue_Bird3");
            birdMove   targetScript = bird.GetComponent <birdMove>();
            dead1 = targetScript.dead;
        }
    }
예제 #4
0
    // Update is called once per frame
    void Update()
    {
        //t.text = "Score" + score;
        GetComponent <TextMesh>().text = "Score : " + score;
        GameObject bird         = GameObject.Find("Blue_Bird3");
        birdMove   targetScript = bird.GetComponent <birdMove>();

        dead1 = targetScript.dead;

        if (dead1)
        {
            GetComponent <TextMesh>().text = "        RIP \n" + "    Score : " + score;

            Vector3 pos = transform.position;
            pos.x = -1;
            pos.y = 0.5f;
            transform.position              = pos;
            GetComponent <TextMesh>().text += "\n Tap to Restart";
        }
    }
예제 #5
0
파일: pl1.cs 프로젝트: parth-p/Flappy-Bird
    // Update is called once per frame
    void Update()
    {
        GameObject bird         = GameObject.Find("Blue_Bird3");
        birdMove   targetScript = bird.GetComponent <birdMove>();

        start1 = targetScript.start;
        if (!dead1 && start1)
        {
            Vector3 pos = transform.position;
            pos.x -= v1 * Time.deltaTime;
            transform.position = pos;

            if (transform.position.x <= -15)
            {
                Vector3 pos1 = transform.position;
                pos1.x             = coordinate.x;
                transform.position = pos1;
            }
            dead1 = targetScript.dead;
        }
    }