Esempio n. 1
0
    void Jump()
    {
        StartCoroutine("Shot2");
        if (updown == 0)
        {
            updown = 1;
            //	dir = 0;
            maxspd = Random.Range(3.5f, 4.5f);
            if (transform.position.x <= 0)
            {
                spddir = 1;
            }

            if (transform.position.x > 0)
            {
                spddir = -1;
            }
        }
        //if (transform.position.x <= 0)
        //maxspd = Random.Range(0,1f + 0.5f * level);
        //if (transform.position.x > 0)
        //	maxspd = Random.Range(-1f - 0.5f * level,0);
        //Debug.Log (maxspd);
        //	aim = -1.2f;
        anm.Jump();
        if ((int)Random.Range(0, 2) == 0)
        {
            rg.velocity = new Vector2(maxspd, 4.4f + 0.5f * (level - 1));
        }
    }
Esempio n. 2
0
 void Jump()
 {
     anm.Jump();
     ChangeDirectionToPlayer();
     spd         = maxspd;
     rg.velocity = new Vector2(rg.velocity.x, 3f);
 }
Esempio n. 3
0
 void Jump()
 {
     updown = 1;
     //if (transform.position.x <= 0)
     //maxspd = Random.Range(0,1f + 0.5f * level);
     //if (transform.position.x > 0)
     //	maxspd = Random.Range(-1f - 0.5f * level,0);
     //Debug.Log (maxspd);
     //	aim = -1.2f;
     anm.Jump();
     rg.velocity = new Vector2(rg.velocity.x, 3 + 1f * level);
 }