/traderous

To get this branch, use:
bzr branch http://9ix.org/bzr/traderous

« back to all changes in this revision

Viewing changes to main.lua

  • Committer: Josh C
  • Date: 2013-05-20 01:09:55 UTC
  • Revision ID: josh@9ix.org-20130520010955-8kzcxxe7sa8pdk8e
don't keep spawning rocks after death.

Show diffs side-by-side

added added

removed removed

Lines of Context:
3
3
 
4
4
require 'zoetrope'
5
5
vector = require 'vector'
 
6
--inspect = require 'inspect'
6
7
 
7
8
require 'group'
8
9
 
146
147
              self.gameStart = love.timer.getTime()
147
148
           end,
148
149
   onUpdate = function(self, dt)
149
 
                 if love.timer.getTime() > self.lastRock + self.rockInterval then
 
150
                 if the.player.active and love.timer.getTime() > self.lastRock + self.rockInterval then
150
151
                    local unseenRock = nil
151
152
                    while not unseenRock do
152
153
                       local rock = Rock:new{
175
176
                 end
176
177
 
177
178
                 the.bullets:collide(the.rockColliders)
 
179
 
 
180
                 -- for _, mirror in ipairs(the.mirrors.sprites) do
 
181
                 --    if not mirror.of then
 
182
                 --       print('mirror:' .. inspect(mirror))
 
183
                 --       error('mirror OF NOTHING')
 
184
                 --    end
 
185
                 -- end
178
186
              end,
179
187
   onEndFrame = function(self)
180
188
                   if the.player.active then
224
232
                 self.console:watch('the.player.y', 'the.player.y')
225
233
                 self.console:watch('the.app.width', 'the.app.width')
226
234
                 self.console:watch('the.app.height', 'the.app.height')
 
235
                 self.console:watch('num mirrors', '#the.mirrors.sprites')
 
236
                 self.console:watch('num rocks', '#the.rocks.sprites')
227
237
                 --self.console:watch('drawTook', 'the.drawTook')
228
238
 
229
239
                 -- back off that dark overlay a bit