GateTrigger = Sprite:extend { onNew = function(self) print(self.x, self.y, self.width, self.height) end, onCollide = function (self, other, xOl, yOl) --print('collide') if the.inventory.items['flag'] then print('have flag') gateup.visible = false gatedown.visible = true the.inventory:remove('flag') end if gateup.visible then self:displace(other) end end }