/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 17:18:46 UTC
  • Revision ID: josh@9ix.org-20130428171846-5m9e3db99r338ppj
foresthut

Show diffs side-by-side

added added

removed removed

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