/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-29 01:54:19 UTC
  • Revision ID: josh@9ix.org-20130429015419-8ts0gwspqonsxkjb
Tags: compo
nameĀ theĀ game

Show diffs side-by-side

added added

removed removed

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