|
|
@ -26,7 +26,6 @@ public class AllAst
|
|
|
|
foreach (var item in As)
|
|
|
|
foreach (var item in As)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
bullet rm = null;
|
|
|
|
bullet rm = null;
|
|
|
|
Rectangle cent = new Rectangle(item.Rect.X - item.Rect.Width / 2, item.Rect.Y - item.Rect.Height / 2, item.Rect.Width, item.Rect.Height);
|
|
|
|
|
|
|
|
foreach (var it in PL.Bullets)
|
|
|
|
foreach (var it in PL.Bullets)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
if (item.Rect.Intersects(it.Rect))
|
|
|
|
if (item.Rect.Intersects(it.Rect))
|
|
|
@ -68,14 +67,13 @@ public class AllAst
|
|
|
|
EX.Add(new Explosion(ase.Rect));
|
|
|
|
EX.Add(new Explosion(ase.Rect));
|
|
|
|
return true;
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
Rectangle cent = new Rectangle(ase.Rect.X - ase.Rect.Width / 2, ase.Rect.Y -ase.Rect.Height / 2, ase.Rect.Width, ase.Rect.Height);
|
|
|
|
if (ase.Rect.Intersects(PL.Rect))
|
|
|
|
if (cent.Intersects(PL.Rect))
|
|
|
|
|
|
|
|
{
|
|
|
|
{
|
|
|
|
PL.Health--;
|
|
|
|
PL.Health--;
|
|
|
|
EX.Add(new Explosion(ase.Rect));
|
|
|
|
EX.Add(new Explosion(ase.Rect));
|
|
|
|
return true;
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (!cent.Intersects(vars.PlayArea))
|
|
|
|
if (!ase.Rect.Intersects(vars.PlayArea))
|
|
|
|
{
|
|
|
|
{
|
|
|
|
return true;
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
}
|
|
|
|