diff options
| author | Elizabeth Alexander Hunt <me@liz.coffee> | 2026-05-14 09:09:08 -0700 |
|---|---|---|
| committer | Elizabeth Alexander Hunt <me@liz.coffee> | 2026-05-14 09:09:08 -0700 |
| commit | 8cd9ec2e98d27b414bc7cff3a5a98b0aad9099ce (patch) | |
| tree | 07d56ae38d4131e571932322b3c5061d12bbd8d6 /math.lua | |
| parent | e51b2ab9998588d2c4c842d861806c81011d751b (diff) | |
| download | dyl8-8cd9ec2e98d27b414bc7cff3a5a98b0aad9099ce.tar.gz dyl8-8cd9ec2e98d27b414bc7cff3a5a98b0aad9099ce.zip | |
Fixes crash on equip
Diffstat (limited to 'math.lua')
| -rw-r--r-- | math.lua | 4 |
1 files changed, 4 insertions, 0 deletions
@@ -14,6 +14,10 @@ Vec2.__div = function(a, b) end Vec2.__tostring = function(a) return "(" .. fmt(a.x) .. "," .. fmt(a.y) .. ")" end +function Vec2:in_bounds(low, hi) + return self.x >= low.x and self.x <= hi.x and self.y >= low.y and self.y <= hi.y +end + function Vec2:magnitude() return sqrt(self.x * self.x + self.y * self.y) end |
