Batman
This commit is contained in:
21
lua/utils.lua
Normal file
21
lua/utils.lua
Normal file
@@ -0,0 +1,21 @@
|
||||
|
||||
utils = {}
|
||||
|
||||
|
||||
--- @param x1 number
|
||||
--- @param x2 number
|
||||
--- @param w1 number
|
||||
--- @param h1 number
|
||||
--- @param y1 number
|
||||
--- @param y2 number
|
||||
--- @param w2 number
|
||||
--- @param h2 number
|
||||
--- @return boolean
|
||||
function utils.check_collision(x1, y1, w1, h1, x2, y2, w2, h2)
|
||||
return x1 < x2 + w2 and
|
||||
x2 < x1 + w1 and
|
||||
y1 < y2 + h2 and
|
||||
y2 < y1 + h1
|
||||
end
|
||||
|
||||
return utils
|
||||
Reference in New Issue
Block a user