Exemple #1
0
 void Jump()
 {
     anm.Jump();
     ChangeDirectionToPlayer();
     spd         = maxspd;
     rg.velocity = new Vector2(rg.velocity.x, 1.5f);
 }
Exemple #2
0
 void Change(bool c)
 {
     if (chase != c)
     {
         if (c == true)
         {
             anm.Jump();
         }
         if (c == false)
         {
             anm.Land();
         }
     }
     chase = c;
 }
Exemple #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);
 }
Exemple #4
0
 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();
     }
 }
Exemple #5
0
 void Jump()
 {
     anm.Jump();
     rg.velocity = new Vector2(rg.velocity.x, 2.5f);
 }
Exemple #6
0
 void Jump()
 {
     land = false;
     anm.Jump();
     rg.velocity = new Vector2(rg.velocity.x, 3f);
 }