Goal = Tile:extend{ image = 'data/goal.png', velocity = {rotation = 2}, ping = love.audio.newSource('data/Pickup_Coin7.wav', 'static'), onCollide = function(self, other) love.audio.play(self.ping) the.goalsAchieved = the.goalsAchieved + 1 self:die() local goals = the.view.goals[tonumber(self.map)] for k, v in pairs(goals) do if v == self then table.remove(goals, k) end end the.view.objects:remove(self) if the.goalsAchieved == 4 then WinView:new():activate() end end }