Ejemplo n.º 1
0
    protected override void Update()
    {
        base.Update();

        string TAG = "__Bird";

        if (this is __Plane)
        {
            TAG = "__Plane";
        }

        if (jump && jumpEnd.y > transform.position.y)
        {
            //Debug.LogWarning(this.GetMethodName() + "[" + TAG + "]" + "[JUMP][ED][DIS]" + (jumpEnd.y - jumpStart.y).ToString("f2"));
            jump = false;
        }

        jumpEnd = transform.position;

        if (GameManager.ActionKeyDown())
        {
            jumpStart = transform.position;
            //Debug.LogWarning(this.GetMethodName() + "[" + TAG + "]" + "[JUMP][ST][POS]" + jumpStart.y.ToString("f2"));
            jump = true;
        }
    }
Ejemplo n.º 2
0
    // Update is called once per frame
    protected virtual void Update()
    {
        float up = 0.0f;  // Upward force

        float t = Time.deltaTime;

        if (GameManager.ActionKeyDown())
        {
            //Debug.LogWarning(this.GetMethodName() + ">>" + (transform.position.y - v3.y).ToString("f4") + ":position.y:" + transform.position.y.ToString("f4") + ":v3.y:" + v3.y.ToString("f4"));
            this.v3 = transform.position;
            v       = 0.0f;
            //up = 8.0f;  // Apply some upward force
            up = j;
        }

        float d = v * t + (up - g) * t * t;

        v           = v + (up - g) * t;
        this.pos.y += d;

        this.delta         = pos.y - transform.position.y;
        transform.position = this.pos;

        PitchBird(this.delta);
    }
Ejemplo n.º 3
0
    protected override void Update()
    {
        if (GameManager.ActionKeyDown())
        {
            GameManager.Play = true;
        }

        if (!GameManager.Play && !GameManager.Dead)
        {
            return;
        }

        if (GameManager.Dead)
        {
            EnableRagdoll();
            this.pos.z = -0.1f;
        }
        else
        {
            DisableRagdoll();
            this.pos.z = 0.0f;
        }

        base.Update();
    }
Ejemplo n.º 4
0
    // Update is called once per frame
    protected virtual void Update()
    {
        if (GameManager.ActionKeyDown())
        {
            this.v3 = transform.position;
            // 속도를 0으로 초기화
            rb.velocity = Vector2.zero;
            // 상승 힘을 부여
            rb.AddForce(Vector2.up * j);
            //Debug.LogWarning(this.GetMethodName() + ">>" + (transform.position.y - v3.y).ToString("f4") + ":position.y:" + transform.position.y.ToString("f4") + ":v3.y:" + v3.y.ToString("f4"));
        }

        this.delta = transform.position.y - pos.y;
        this.pos   = transform.position;

        PitchBird(this.delta);
    }
Ejemplo n.º 5
0
    // Update is called once per frame
    void Update()
    {
        if (GameManager.ResetKeyDown())
        {
            SceneManager.LoadScene(SceneManager.GetActiveScene().name);
            return;
        }

        if ((DateTime.Now - st).TotalMilliseconds < COUNT_DOWN * MSC2SEC)
        {
            //Debug.Log(this.GetMethodName() + "\t" + (DateTime.Now - GameManager.st).TotalMilliseconds);
            return;
        }

        if (GameManager.ActionKeyDown())
        {
            //Debug.LogWarning(this.GetMethodName() + "!!!START!!!\t" + (DateTime.Now - GameManager.st).TotalMilliseconds);
            GameManager.Play = true;
        }
    }
Ejemplo n.º 6
0
    protected override void Update()
    {
        base.Update();

        if (!GameManager.Play && !GameManager.Dead)
        {
            return;
        }

        if (!GameManager.Dead)
        {
            if (GameManager.ActionKeyDown())
            {
                AniSpeedUP();
            }
            else
            {
                AniSpeedDOWN();
            }
        }
    }