added Rect class

This commit is contained in:
binarycat
2022-03-12 11:12:29 -05:00
parent 97de68e34b
commit 27f1dc71c0
3 changed files with 71 additions and 0 deletions

View File

@@ -88,3 +88,7 @@ function Collision:draw(color)
love.graphics.setColor(0,1,90,0.5)
love.graphics.rectangle("line",self.from.x-Camera.pos.x, self.from.y-Camera.pos.y, self.width, self.height)
end
function Collision:asRect()
return Rect:fromCoords(self.from.x, self.from.y, self.to.x, self.to.y)
end