/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-15 02:54:06 UTC
  • Revision ID: josh@9ix.org-20131215025406-l1gkpunh7xkmxlaq
and a player "graphic"

Show diffs side-by-side

added added

removed removed

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