/ld26

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

« back to all changes in this revision

Viewing changes to main.lua

  • Committer: Josh C
  • Date: 2013-04-28 18:51:02 UTC
  • Revision ID: josh@9ix.org-20130428185102-2gekwj8pzvlnwvhb
collision tweaks

Show diffs side-by-side

added added

removed removed

Lines of Context:
51
51
                   }
52
52
                end
53
53
   },
54
 
   village = {
 
54
   -- village = {
 
55
   --    objects = function() return {
 
56
   --                    Tile:new{image = 'data/village-bg.png'},
 
57
   --                    Player:new{x = 121, y = 440,
 
58
   --                               image = 'data/village-player.png'},
 
59
   --                 }
 
60
   --              end
 
61
   -- },
 
62
   bridge = {
55
63
      objects = function() return {
56
 
                      Tile:new{image = 'data/village-bg.png'},
 
64
                      Tile:new{image = 'data/bridge-bg.png'},
57
65
                      Player:new{x = 121, y = 440,
58
 
                                 image = 'data/village-player.png'},
 
66
                                 image = 'data/bridge-player.png'},
 
67
                      Tile:new{image = 'data/bridge-fg.png'}
59
68
                   }
60
69
                end
61
70
   }
65
74
   level = 'shore', --default level
66
75
   onNew = function (self)
67
76
              --print('loading level: '..self.level)
 
77
              if not levels[self.level] then
 
78
                 error('no such level: '..self.level)
 
79
              end
68
80
              for _, obj in ipairs(levels[self.level].objects()) do
69
81
                 self:add(obj)
70
82
              end