/spacey

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

« back to all changes in this revision

Viewing changes to rock.lua

  • Committer: Josh C
  • Date: 2013-05-04 20:45:17 UTC
  • Revision ID: josh@9ix.org-20130504204517-1rfp92svud12kg42
zoetrope 1.4

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
Rock = WrapTile:extend {
2
 
   image = 'data/rock.png',
3
 
   onNew = function(self)
4
 
              --self.velocity = util.shortestVector(self, the.player):normalized() * 10
5
 
           end,
6
 
   onEndFrame = function(self, dt)
7
 
                   -- onEndFrame to give a chance to go out of bounds then wrap
8
 
 
9
 
                   if DEBUG and the.console.visible then
10
 
                      if not self.text then
11
 
                         self.text = Text:new()
12
 
                         the.view:add(self.text)
13
 
                      end
14
 
                      
15
 
                      local pVec = util.shortestVector(self, the.player)
16
 
                      self.text.text = pVec.x .. ', ' .. pVec.y
17
 
                      self.text.x, self.text.y = self.x, self.y
18
 
                      self.text.visible = true
19
 
                   else
20
 
                      if self.text then
21
 
                         self.text.visible = false
22
 
                      end
23
 
                   end
24
 
                end
25
 
}
 
 
b'\\ No newline at end of file'