/traderous

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

« back to all changes in this revision

Viewing changes to wrap_tile.lua

  • Committer: Josh C
  • Date: 2013-05-13 21:23:20 UTC
  • Revision ID: josh@9ix.org-20130513212320-t1sgc5dcpjwmjp38
mirror (contains a bug where things in the corner aren't getting mirrored?

Show diffs side-by-side

added added

removed removed

Lines of Context:
60
60
                  self.yMirror = nil
61
61
                  -- die?
62
62
               end
63
 
 
64
 
               if self.x ~= mirrorX and self.y ~= mirrorY then
65
 
                  if not self.xyMirror then
66
 
                     --print('creating mirror: X='..xyMirrorX..' Y='..xyMirrorY)
67
 
 
68
 
                     self.xyMirror = Tile:new{ image = self.image }
69
 
                     the.app.view:add(self.xyMirror)
70
 
                  end
71
 
 
72
 
                  self.xyMirror.x = mirrorX
73
 
                  self.xyMirror.y = mirrorY
74
 
                  self.xyMirror.rotation = self.rotation
75
 
               elseif self.xyMirror then
76
 
                  the.app.view:remove(self.xyMirror)
77
 
                  self.xyMirror = nil
78
 
                  -- die?
79
 
               end
80
63
            end,
81
 
   onRemove = function(self)
82
 
                 if self.xMirror then
83
 
                    the.app.view:remove(self.xMirror)
84
 
                 end
85
 
 
86
 
                 if self.yMirror then
87
 
                    the.app.view:remove(self.yMirror)
88
 
                 end
89
 
 
90
 
                 if self.xyMirror then
91
 
                    the.app.view:remove(self.xyMirror)
92
 
                 end
93
 
              end,
94
64
   update = function (self, elapsed)
95
65
               Tile.update(self, elapsed)
96
66