/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 05:22:34 UTC
  • Revision ID: josh@9ix.org-20130428052234-4jjiqqj1qdgczx1w
don't pick things up twice

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 = {
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)