Beispiel #1
0
 public void CheckOhter()
 {
     foreach (var m in map.MapThings)
     {
         if (m is Igniter)
         {
             if (!((Igniter)m).IsToDeath)
             {
                 if (ColRect.Intersects(m.ColRect))
                 {
                     m.EventHandle(this);
                 }
             }
         }
         if (m is Bomb)
         {
             if (!((Bomb)m).IsDead)
             {
                 if (ColRect.Intersects(m.ColRect))
                 {
                     m.EventHandle(this);
                 }
             }
         }
     }
 }
Beispiel #2
0
        /// <summary>
        /// 四角同士の衝突区域判定
        /// </summary>
        /// <param name="other">判定する対象</param>
        /// <returns></returns>
        public virtual bool CollisionCheck(GameObject other)
        {
            bool flag = false;

            flag = ColRect.Intersects(other.ColRect);
            return(flag);
        }
Beispiel #3
0
        /// <summary>
        /// 爆発
        /// </summary>
        public void Explosion()
        {
            //エフェクト用のポジション取得 by長谷川
            effectPosition = new Vector2(position.X - 64, position.Y - 64);

            //アニメーションを開始
            IsAnimation = true;

            //当たり判定変更
            isTrigger = true;
            //当たり判定範囲拡大
            localColRect.Offset(-1, -1);
            localColRect.Width  += 2;
            localColRect.Height += 2;

            //SE
            sound.PlaySE("bomb1");

            //爆発処理
            foreach (var m in map.MapThings)
            {
                if (ColRect.Intersects(m.ColRect))
                {
                    m.EventHandle(this);
                }
            }
        }
Beispiel #4
0
        /// <summary>
        /// 四角同士の衝突区域判定
        /// </summary>
        /// <param name="other">判定する対象</param>
        /// <returns></returns>
        public virtual bool CollisionCheck(GameObject other)
        {
            bool flag = false;//Method.CollisionCheck(position + colOffset, colSize.Width, colSize.Height, other.position + other.colOffset, other.colSize.Width, other.colSize.Height);

            flag = ColRect.Intersects(other.ColRect);
            return(flag);
        }
Beispiel #5
0
 public void CheckOhterStraw()
 {
     foreach (var m in map.MapThings)
     {
         if (m is Straw)
         {
             if (!((Straw)m).IsToDeath)
             {
                 if (ColRect.Intersects(m.ColRect))
                 {
                     m.EventHandle(this);
                 }
             }
         }
     }
 }