/ld26

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