/ld28

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

« back to all changes in this revision

Viewing changes to player.lua

  • Committer: Josh C
  • Date: 2013-12-14 22:33:14 UTC
  • Revision ID: josh@9ix.org-20131214223314-gxlkcixtm6ma1mlr
put some walls and a goal... doesn't feel quite right.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
Player = Tile:extend {
2
 
   image = 'data/player.png',
 
1
local dirs = {'left', 'right', 'up', 'down'}
 
2
 
 
3
Player = Fill:extend {
 
4
   fill = {255,0,0},
 
5
   width = 16, height = 16,
3
6
   queue = deque.new(),
4
7
   onNew = function(self)
5
 
              local delay = {0,1,2}
6
 
              for _ = 1, delay[the.view.level] do
 
8
              for _ = 1, 2 do
7
9
                 self.queue:push_right(dirs[math.random(1,4)])
8
10
              end
9
11
           end,
37
39
                 end
38
40
              end,
39
41
   onCollide = function(self, other)
40
 
                  if other ~= the.view.map and other ~= the.goalPerson then
 
42
                  if other ~= the.view.map then
41
43
                     --print('collision')
42
44
 
43
45
                     other:displaceDir(self,