/// <summary> /// 横のヒット通知 /// </summary> /// <param name="other"></param> public override void HitX(Charactor other) { //左右に跳ね返り speed.X *= -1; //if(other is CenterPaddle) //{ // //sound.PlaySE(""); //} }
/// <summary> /// 追加 /// </summary> /// <param name="charactor"></param> public void Add(Charactor charactor) { //早期リターン:することがなければ何もしない if (charactor == null) { return; } //追加リストにキャラ追加 addNewCharacters.Add(charactor); }
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); }
/// <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; } }
//当たり判定 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); }
public override void HitX(Charactor other) { }
/// <summary> /// ヒット通知 /// </summary> /// <param name="other"></param> public override void Hit(Charactor other) { isDeadFlag = true; //sound.PlaySE(""); }
public override void Hit(Charactor other) { isDeadFlag = true; }
public abstract void Hit(Charactor other); //ヒット通知 public abstract void HitX(Charactor other); //X方向ヒット通知
public abstract void Update(GameTime gameTime); //更新 public abstract void Hit(Charactor other); //ヒット通知