return function(animation, x, y) local object = { x = x , y = y , frame = 0 , animation = animation , grabbed = false } function object:draw() if mouseIsPressed and not taken and self:contains(mouseX, mouseY) and not self.grabbed then self.grabbed = true taken = true elseif not mouseIsPressed then self.grabbed = false taken = false print(animation, self.x, self.y) end self:animate() if self.grabbed then self.x = mouseX self.y = mouseY end end require "is.animated" (object) require "is.sized" (object) return object end