/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:
24
24
                      Tile:new{image = 'data/forest1-fg.png'}
25
25
                   } end,
26
26
   },
 
27
   foresthut = {
 
28
      objects = function() return {
 
29
                      Tile:new{image = 'data/foresthut-bg.png'},
 
30
                      Player:new{x = 745, y = 430,
 
31
                                 image = 'data/forest1-player.png'},
 
32
                      Tile:new{image = 'data/foresthut-fg.png'}
 
33
                   } end,
 
34
   },
27
35
   shore = {
28
36
      objects = function() return {
29
37
                      Tile:new{image = 'data/shore-bg.png'},
54
62
}
55
63
 
56
64
GameView = View:extend {
57
 
   level = 'forest1', --default level
 
65
   level = 'shore', --default level
58
66
   onNew = function (self)
59
67
              --print('loading level: '..self.level)
60
68
              for _, obj in ipairs(levels[self.level].objects()) do
79
87
             love.graphics.print('version:' .. VERSION, 20, 570)
80
88
          end,
81
89
   onUpdate = function (self, dt)
82
 
                 if the.keys:justPressed('a') then
83
 
                    the.app.view = GameView:new{level = 'forest1'}
84
 
                 elseif the.keys:justPressed('b') then
85
 
                    the.app.view = GameView:new{level = 'shore'}
86
 
                 end
87
90
              end
88
91
}
89
92