/ld26

To get this branch, use:
bzr branch http://9ix.org/bzr/ld26

« back to all changes in this revision

Viewing changes to gatetrigger.lua

  • Committer: Josh C
  • Date: 2013-04-28 05:22:34 UTC
  • Revision ID: josh@9ix.org-20130428052234-4jjiqqj1qdgczx1w
don't pick things up twice

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
GateTrigger = Sprite:extend {
2
 
   onNew = function(self)
3
 
              --print(self.x, self.y, self.width, self.height)
4
 
           end,
5
 
   onCollide = function (self, other, xOl, yOl)
6
 
                    --print('collide')
7
 
                    if the.inventory.items['flag'] then
8
 
                       print('have flag')
9
 
 
10
 
                       gateup.visible = false
11
 
                       gatedown.visible = true
12
 
 
13
 
                       the.inventory:remove('flag')
14
 
                    end
15
 
 
16
 
                    if gateup.visible then
17
 
                       self:displace(other)
18
 
                    end
19
 
                 end
20
 
}
 
 
b'\\ No newline at end of file'