void Jump() { anm.Jump(); ChangeDirectionToPlayer(); spd = maxspd; rg.velocity = new Vector2(rg.velocity.x, 1.5f); }
void Change(bool c) { if (chase != c) { if (c == true) { anm.Jump(); } if (c == false) { anm.Land(); } } chase = c; }
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); }
void Move() { ChangeDirectionToPlayer(); if (transform.position.x > player.transform.position.x) { if (rg.velocity.x > -level * 1f) { rg.velocity = new Vector2(rg.velocity.x - (0.1f), rg.velocity.y); } } if (transform.position.x < player.transform.position.x) { if (rg.velocity.x < level * 1f) { rg.velocity = new Vector2(rg.velocity.x + (0.1f), rg.velocity.y); } } if (Mathf.Abs(transform.position.x - player.transform.position.x) < 0.2f) { actnum = 1; anm.Jump(); } }
void Jump() { anm.Jump(); rg.velocity = new Vector2(rg.velocity.x, 2.5f); }
void Jump() { land = false; anm.Jump(); rg.velocity = new Vector2(rg.velocity.x, 3f); }