/ld28

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

« back to all changes in this revision

Viewing changes to notplayer.lua

  • Committer: Josh C
  • Date: 2013-12-14 03:41:24 UTC
  • Revision ID: josh@9ix.org-20131214034124-vsekv7pyk6z5bvqf
basic delayed movement

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
NotPlayer = Fill:extend {
2
 
   fill = {255,0,0},
3
 
   width = 16, height = 16,
4
 
   queue = deque.new(),
5
 
   doMove = function(self)
6
 
               local dir = math.random(1,5)
7
 
 
8
 
               if dir == 1 then
9
 
                  self.x = self.x - self.width
10
 
               elseif dir == 2 then
11
 
                  self.x = self.x + self.width
12
 
               elseif dir == 3 then
13
 
                  self.y = self.y - self.height
14
 
               elseif dir == 4 then
15
 
                  self.y = self.y + self.height
16
 
               end
17
 
            end
18
 
}
 
 
b'\\ No newline at end of file'