private bool CheckFall(bool isRight) { if (isRight) { bezierPoint.ToRight((int)speed); } else { bezierPoint.ToLeft((int)speed); } if (bezierPoint.IsEnd()) { state.IsJump = true; return(true); } bezierPoint.Rotate(); return(false); }
private void Move() { UpdateIsWall(); if (playerDirection.IsRight()) { bezierPoint.ToRight((int)speed); } else { bezierPoint.ToLeft((int)speed); } if (bezierPoint.IsEnd()) { state.IsJump = true; return; } bezierPoint.Rotate(); entity.transform.Position = bezierPoint.GetNowPosition(); }
//チェックしながら落下処理 private void CheckLand() { float powercut = 0; float cutPower = 3f; //チェック間隔設定 Vector2 testPosition = bezierPoint.GetNowPosition(); //落下チェック while (currentJumpPower > 0) { if (currentJumpPower < cutPower) { cutPower = currentJumpPower; } entity.transform.Position += new Vector2(0, cutPower); currentJumpPower -= cutPower; powercut += cutPower; if (bezierPoint.IsEnd()) { continue; } if (testPosition == Vector2.Zero) { continue; } if (entity.transform.Position.Y >= testPosition.Y - 10 && entity.transform.Position.Y <= testPosition.Y + 5) { state.IsLand = true; animControl.SetNowAnim("Run"); break; } } entity.transform.Position += new Vector2(0, currentJumpPower); currentJumpPower += powercut; }