/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 16:51:36 UTC
  • Revision ID: josh@9ix.org-20130428165136-f3eg4lscd1mdb9wo
level tweaks

Show diffs side-by-side

added added

removed removed

Lines of Context:
9
9
require 'player'
10
10
require 'transition'
11
11
require 'displacer'
 
12
require 'inventory'
 
13
require 'flower'
 
14
 
12
15
require 'svg_levels'
13
16
 
14
17
levels = {
51
54
}
52
55
 
53
56
GameView = View:extend {
54
 
   level = 'forest1', --default level
 
57
   level = 'shore', --default level
55
58
   onNew = function (self)
56
59
              --print('loading level: '..self.level)
57
60
              for _, obj in ipairs(levels[self.level].objects()) do
58
61
                 self:add(obj)
59
62
              end
60
63
              for _, obj in ipairs(svg_objects[self.level]) do
61
 
                 self:add(obj)
 
64
                 if not the.inventory.items[obj.name] then
 
65
                    self:add(obj)
 
66
                 end
62
67
              end
63
68
 
 
69
              self:add(the.inventory)
 
70
 
64
71
              self:flash({0,0,0})
65
72
 
66
73
              --self.focus = the.player
68
75
           end,
69
76
   draw = function (self, x, y)
70
77
             View.draw(self, x, y)
71
 
             love.graphics.print('FPS:' .. love.timer.getFPS(), 20, 20)
 
78
             --love.graphics.print('FPS:' .. love.timer.getFPS(), 20, 20)
72
79
             love.graphics.print('version:' .. VERSION, 20, 570)
73
80
          end,
74
81
   onUpdate = function (self, dt)