/ld26

To get this branch, use:
bzr branch /bzr/ld26

« back to all changes in this revision

Viewing changes to gatetrigger.lua

  • Committer: Josh C
  • Date: 2013-04-28 01:24:54 UTC
  • Revision ID: josh@9ix.org-20130428012454-b7kpooluezexnvde
fade out

Show diffs side-by-side

added added

removed removed

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
 
}
 
 
'\\ No newline at end of file'