From 8a09110ac87be32489812deafc2c99e69ab1589f Mon Sep 17 00:00:00 2001 From: Kazhnuz Date: Sun, 31 Mar 2019 11:52:04 +0200 Subject: [PATCH] battlesystem: add mask system --- sonic-radiance.love/assets/gui/tilemask.png | Bin 0 -> 222 bytes .../battlesystem/controller/battlearena.lua | 45 ++++++++++++++++++ 2 files changed, 45 insertions(+) create mode 100644 sonic-radiance.love/assets/gui/tilemask.png diff --git a/sonic-radiance.love/assets/gui/tilemask.png b/sonic-radiance.love/assets/gui/tilemask.png new file mode 100644 index 0000000000000000000000000000000000000000..c74d0444b807d07534edb0e663d2ec040c442caa GIT binary patch literal 222 zcmeAS@N?(olHy`uVBq!ia0vp^8bB<)^mS!_%q-8Tsnn|}EeaHpEOCt}an8@pP0cG|a4t$sEJ;mK zD90= x1) and (x <= x2) and (y >= y1) and (y <= y2)) + elseif shape == "circle" then + local lenght = utils.math.pointDistance(x, y, ox, oy) + return (lenght <= size) + elseif shape == "fullheight" then + local x2 = ox + (size*direction) + return ((x >= ox) and (x <= x2)) + elseif shape == "fullwidth" then + local y2 = oy + (size*direction) + return ((y >= oy) and (y <= y2)) + elseif shape == "line" then + local x2 = ox + (size*direction) + return ((y == oy) and (x >= ox) and (x <= x2)) + elseif shape == "column" then + local y2 = oy + (size*direction) + return ((x == ox) and (y >= oy) and (y <= y2)) + elseif shape == "everything" then + return true + end +end + return BattleArena