/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:52:51 UTC
  • Revision ID: josh@9ix.org-20130428185251-a9cpmdjiooz89gu5
s/basecode/ld26/

Show diffs side-by-side

added added

removed removed

Lines of Context:
10
10
require 'transition'
11
11
require 'displacer'
12
12
require 'inventory'
 
13
require 'flower'
13
14
require 'levels'
14
 
require 'items'
15
 
require 'troll'
16
15
 
17
16
require 'svg_levels'
18
17
 
19
18
GameView = View:extend {
 
19
   level = 'shore', --default level
20
20
   onNew = function (self)
21
21
              --print('loading level: '..self.level)
22
22
              if not levels[self.level] then
41
41
   draw = function (self, x, y)
42
42
             View.draw(self, x, y)
43
43
             --love.graphics.print('FPS:' .. love.timer.getFPS(), 20, 20)
44
 
             --love.graphics.print('version:' .. VERSION, 20, 570)
 
44
             love.graphics.print('version:' .. VERSION, 20, 570)
45
45
          end,
46
46
   onUpdate = function (self, dt)
47
47
              end
48
48
}
49
49
 
50
50
the.app = App:new {
51
 
   level = 'shore', --default level
52
51
   onRun = function (self)
53
 
              print('Version: ' .. VERSION)
54
 
              self.view = GameView:new{level = self.level}
 
52
              self.view = GameView:new()
55
53
              if DEBUG then
56
54
                 self.console:watch('VERSION', 'VERSION')
57
55
                 self.console:watch('updateTook', 'the.updateTook')
62
60
                 -- back off that dark overlay a bit
63
61
                 self.console.fill.fill[4] = 75
64
62
              end
65
 
 
66
 
              the.inventory:add(Flower:new())
67
63
           end,
68
64
   onUpdate = function (self, dt)
69
65
                 if the.keys:justPressed('escape') then
82
78
-- for accessing from debug console
83
79
function l(level)
84
80
   the.app.view = GameView:new{level = level}
85
 
end
86
 
 
87
 
function love.load(arg)
88
 
   if arg[2] then
89
 
      the.app.level = arg[2]
90
 
   end
91
 
 
92
 
   the.app:run()
93
81
end
 
 
b'\\ No newline at end of file'