Example #1
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();
        }
Example #2
0
 private void SetDirection(int direction)
 {
     if (direction > 0)
     {
         playerDirection.SetRight(true);
         Camera2D.TurnRight();
     }
     else if (direction < 0)
     {
         playerDirection.SetLeft(true);
         Camera2D.TurnLeft();
     }
     else
     {
         playerDirection.SetNone();
     }
 }
Example #3
0
 private void CheckDirection()
 {
     if (player.transform.Position.X > entity.transform.Position.X + 200)
     {
         childDirection.SetNowRight(false);
     }
     else if (player.transform.Position.X < entity.transform.Position.X - 200)
     {
         childDirection.SetNowLeft(false);
     }
     else
     {
         childDirection.SetNone();
     }
     if (IsChildForward())
     {
         childDirection.SetNone();
     }
     CheckFruit();
 }