private void CheckInOverseeArea() { if (entity.transform.Position.X <= moveAreaLeft) { eagleDirection.SetRight(false); overseeOffset.X = Math.Abs(overseeOffset.X); moveTimer.Initialize(); } else if (entity.transform.Position.X >= moveAreaRight) { eagleDirection.SetLeft(false); overseeOffset.X = -Math.Abs(overseeOffset.X); moveTimer.Initialize(); } }
//ジャンプ中移行チェック private void JumpingMove() { int direction = 0; if (childDirection.IsRight()) { entity.transform.Angle = 360; childDirection.SetRight(true); direction = 1; speed = startSpeed; } else if (childDirection.IsLeft()) { entity.transform.Angle = 180; childDirection.SetLeft(true); direction = -1; speed = startSpeed; } else { childDirection.SetNone(); } //横移動後チェック entity.transform.Position += new Vector2((int)speed * direction, 0); //MovePointCheck bezierPoint.CheckJumpMove(); }
private void CheckDirection() { if (entity.transform.Position.X <= moveAreaLeft) { childDirection.SetRight(false); } else if (entity.transform.Position.X >= moveAreaRight) { childDirection.SetLeft(false); } }
private void SetDirection(int direction) { if (direction > 0) { playerDirection.SetRight(false); Camera2D.TurnRight(); } else if (direction < 0) { playerDirection.SetLeft(false); Camera2D.TurnLeft(); } }
private void ActionCheck() { if (player.transform.Position.X > entity.transform.Position.X + 50 && Vector2.DistanceSquared(player.transform.Position, entity.transform.Position) < 800 * 800) { childDirection.SetRight(false); speed = startSpeed; isPatrol = false; } else if (player.transform.Position.X < entity.transform.Position.X - 50 && Vector2.DistanceSquared(player.transform.Position, entity.transform.Position) < 800 * 800) { childDirection.SetLeft(false); speed = startSpeed; isPatrol = false; } else { //childDirection.SetNone(); isPatrol = true; } }