fixed centering

main 0.2
RedStealthDev 2 years ago
parent c313194009
commit 3b44c3733e

@ -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;
} }

@ -7,4 +7,4 @@ build_property.InvariantGlobalization =
build_property.PlatformNeutralAssembly = build_property.PlatformNeutralAssembly =
build_property._SupportedPlatformList = Linux,macOS,Windows build_property._SupportedPlatformList = Linux,macOS,Windows
build_property.RootNamespace = Asteroids build_property.RootNamespace = Asteroids
build_property.ProjectDir = E:\Repos\Asteroids\ build_property.ProjectDir = e:\Repos\Asteroids\

Loading…
Cancel
Save