예제 #1
0
 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();
     }
 }
예제 #2
0
        //ジャンプ中移行チェック
        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();
        }
예제 #3
0
 private void CheckDirection()
 {
     if (entity.transform.Position.X <= moveAreaLeft)
     {
         childDirection.SetRight(false);
     }
     else if (entity.transform.Position.X >= moveAreaRight)
     {
         childDirection.SetLeft(false);
     }
 }
예제 #4
0
 private void SetDirection(int direction)
 {
     if (direction > 0)
     {
         playerDirection.SetRight(false);
         Camera2D.TurnRight();
     }
     else if (direction < 0)
     {
         playerDirection.SetLeft(false);
         Camera2D.TurnLeft();
     }
 }
예제 #5
0
 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;
     }
 }
예제 #6
0
        public override void Active()
        {
            base.Active();
            //TODO 更新コンテナに自分を入れる

            childDirection = (C_Switch3)entity.GetNormalComponent("C_Switch3");
            bezierPoint    = (C_BezierPoint)entity.GetNormalComponent("C_BezierPoint");

            childDirection.SetRight(false);

            if (childDirection.IsRight())
            {
                entity.transform.Angle = 360;
            }
            else if (childDirection.IsLeft())
            {
                entity.transform.Angle = 180;
            }
            else if (childDirection.IsNone())
            {
                entity.transform.Angle = 360;
            }
        }