示例#1
0
 /// <summary>
 /// 横のヒット通知
 /// </summary>
 /// <param name="other"></param>
 public override void HitX(Charactor other)
 {
     //左右に跳ね返り
     speed.X *= -1;
     //if(other is CenterPaddle)
     //{
     //    //sound.PlaySE("");
     //}
 }
示例#2
0
 /// <summary>
 /// 追加
 /// </summary>
 /// <param name="charactor"></param>
 public void Add(Charactor charactor)
 {
     //早期リターン:することがなければ何もしない
     if (charactor == null)
     {
         return;
     }
     //追加リストにキャラ追加
     addNewCharacters.Add(charactor);
 }
示例#3
0
        public int IsBlockCollision(Charactor other)
        {
            int Blockposition = BlockVsCircle(rect, other.position + new Vector2(16, 16));

            if (Blockposition == 1 || Blockposition == 2)
            {
                return(0);
            }
            if (Blockposition == 3 || Blockposition == 4)
            {
                return(1);
            }
            return(2);
        }
示例#4
0
 /// <summary>
 /// ヒット通知
 /// </summary>
 /// <param name="other"></param>
 public override void Hit(Charactor other)
 {
     if (other is CenterPaddle)
     {
         CenterHit();
     }
     else if (other is RightPaddle)
     {
         RigthHit();
     }
     else if (other is LeftPaddle)
     {
         LeftHit();
     }
     else
     {
         //上下に跳ね返り
         speed.Y *= -1;
     }
 }
示例#5
0
        //当たり判定
        public int IsPaddleCollision(Charactor other)
        {
            //if(LineVsCircle(new Vector2(rect.Left, rect.Top),
            //    new Vector2(rect.Right, rect.Top),
            //    other.position + new Vector2(16, 16),
            //    16f))
            //{
            //    return true;
            //}
            //return false;

            int PaddlePosition = BlockVsCircle(rect, other.position + new Vector2(16, 16));

            if (PaddlePosition == 1 || PaddlePosition == 2)
            {
                return(0);
            }
            if (PaddlePosition == 3 || PaddlePosition == 4)
            {
                return(1);
            }
            return(2);
        }
示例#6
0
 public override void HitX(Charactor other)
 {
 }
示例#7
0
 /// <summary>
 /// ヒット通知
 /// </summary>
 /// <param name="other"></param>
 public override void Hit(Charactor other)
 {
     isDeadFlag = true;
     //sound.PlaySE("");
 }
示例#8
0
 public override void Hit(Charactor other)
 {
     isDeadFlag = true;
 }
示例#9
0
 public abstract void Hit(Charactor other);      //ヒット通知
 public abstract void HitX(Charactor other);     //X方向ヒット通知
示例#10
0
 public abstract void Update(GameTime gameTime); //更新
 public abstract void Hit(Charactor other);      //ヒット通知