Website Summary Files Commits Branches @commit @diff @stats
path: root / src / Web / PUSG.Web / Models / CollisionEngine.cs
diff options
context:
space:
mode:
1 files changed, 16 insertions, 0 deletions
-rw-r--r--src/Web/PUSG.Web/Models/CollisionEngine.cs16
diff --git a/src/Web/PUSG.Web/Models/CollisionEngine.cs b/src/Web/PUSG.Web/Models/CollisionEngine.cs
new file mode 100644
index 0000000..4ae2e13
--- /dev/null
+++ b/src/Web/PUSG.Web/Models/CollisionEngine.cs
@@ -0,0 +1,16 @@
+using System.Drawing;
+
+namespace PUSG.Web.Models
+{
+ public class CollisionEngine
+ {
+ public static bool CollidesTankWithShell(BaseGameObject tank, BaseGameObject shell)
+ {
+ Rectangle targetRectangle = new Rectangle((int)tank.X, (int)tank.Y, 50, 40);
+
+ Rectangle colliderRectangle = new Rectangle((int)shell.X, (int)shell.Y, 25, 25);
+
+ return colliderRectangle.IntersectsWith(targetRectangle);
+ }
+ }
+}