/ld27

To get this branch, use:
bzr branch /bzr/ld27
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
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
}