/ld26

To get this branch, use:
bzr branch /bzr/ld26

« back to all changes in this revision

Viewing changes to main.lua

  • Committer: Josh C
  • Date: 2013-04-28 20:26:21 UTC
  • Revision ID: josh@9ix.org-20130428202621-ey328vc42y1hkcv9
castle interior

Show diffs side-by-side

added added

removed removed

2
2
DEBUG = true
3
3
 
4
4
require 'zoetrope'
5
 
--inspect = require 'inspect'
6
5
 
7
6
--require 'sprite'
8
7
require 'version'
11
10
require 'transition'
12
11
require 'displacer'
13
12
require 'inventory'
 
13
require 'flower'
14
14
require 'levels'
15
 
require 'items'
16
 
require 'troll'
17
 
require 'gatetrigger'
18
 
require 'fairyactivator'
19
 
require 'realfairy'
20
15
 
21
16
require 'svg_levels'
22
17
 
28
23
              end
29
24
              for _, obj in ipairs(levels[self.level].objects()) do
30
25
                 self:add(obj)
31
 
                 --if obj.gateup then print('ADDING GATEUP') end
32
26
              end
33
27
              for _, obj in ipairs(svg_objects[self.level]) do
34
28
                 if not the.inventory.items[obj.name] then
35
29
                    self:add(obj)
36
30
                 end
37
 
                 if obj.name == 'flag' then
38
 
                    self:add(obj)
39
 
                 end
40
31
              end
41
32
 
42
 
              --self:add(Fill:new{x=100,y=100,width=25,height=25,fill={255,255,255}})
43
 
 
44
33
              self:add(the.inventory)
45
34
 
46
35
              self:flash({0,0,0})
51
40
   draw = function (self, x, y)
52
41
             View.draw(self, x, y)
53
42
             --love.graphics.print('FPS:' .. love.timer.getFPS(), 20, 20)
54
 
             --love.graphics.print('version:' .. VERSION, 20, 570)
 
43
             love.graphics.print('version:' .. VERSION, 20, 570)
55
44
          end,
56
45
   onUpdate = function (self, dt)
57
46
              end
60
49
the.app = App:new {
61
50
   level = 'shore', --default level
62
51
   onRun = function (self)
63
 
              print('Version: ' .. VERSION)
64
52
              self.view = GameView:new{level = self.level}
65
53
              if DEBUG then
66
54
                 self.console:watch('VERSION', 'VERSION')
72
60
                 -- back off that dark overlay a bit
73
61
                 self.console.fill.fill[4] = 75
74
62
              end
75
 
 
76
 
              --the.inventory:add(Flag:new())
77
 
              the.inventory:add(Fairy:new())
78
63
           end,
79
64
   onUpdate = function (self, dt)
80
65
                 if the.keys:justPressed('escape') then