Website Summary Files Commits Branches @commit @diff @stats
path: root / src / Web / PUSG.Web / Models / CollisionEngine.cs
diff options
context:
space:
mode:
Commite8ee7b69663a95d97b226266ebe3ccc95e13c309 (patch)
Author
 ivaylo.zhelev <ivaylo.zhelev@solarwinds.com>
2021-01-31 16:42:30 +0200
Committer
 ivaylo.zhelev <ivaylo.zhelev@solarwinds.com>
2021-01-31 16:42:30 +0200
Files9eed7de1b817c812d61514950a9299aa2cb8d887 /src/Web/PUSG.Web/Models/CollisionEngine.cs
pusg-api-e8ee7b69663a95d97b226266ebe3ccc95e13c309.tar
pusg-api-e8ee7b69663a95d97b226266ebe3ccc95e13c309.tar.gz
pusg-api-e8ee7b69663a95d97b226266ebe3ccc95e13c309.zip
Parent6fb05a2a6f94e008dc689291d0522f39f87a6622 (diff)
Major Business Logic Implementation
* Added GameHub * Added Back-End Game Loop and Game Mechanics * Added End Game and Result message
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);
+ }
+ }
+}