diff --git a/static/script.js b/static/script.js index 4fb0d62..3e7b3ca 100644 --- a/static/script.js +++ b/static/script.js @@ -432,6 +432,13 @@ class Game { } +function rectangleOverlap(rect1, rect2) { + return rect1.x < rect2.x + rect2.w && + rect1.x + rect1.w > rect2.x && + rect1.y < rect2.y + rect2.h && + rect1.y + rect1.h > rect2.y; +} + const game = new Game({ canvasId: 'canvas', chatInputId: 'msg',