/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-06-23 03:10:51 UTC
  • Revision ID: josh@9ix.org-20130623031051-3142chix333jkmqi
pay to fix shield

Show diffs side-by-side

added added

removed removed

Lines of Context:
19
19
require 'planet'
20
20
require 'trade_view'
21
21
require 'shield'
22
 
require 'pause_view'
23
22
 
24
23
util = {
25
24
   signOf = function(value)
118
117
              self.focus = the.player
119
118
           end,
120
119
   onUpdate = function(self, dt)
121
 
                 if the.keys:justPressed('escape') then
122
 
                    PauseView:new():activate()
123
 
                 end
124
 
 
125
120
                 the.bullets:collide(the.planets)
126
121
                 the.bullets:collide(the.player)
127
122
                 the.bullets:collide(the.enemies)
168
163
                 self.console:watch('num mirrors', '#the.mirrors.sprites')
169
164
                 self.console:watch('num rocks', '#the.rocks.sprites')
170
165
                 self.console:watch('num planets', '#the.planets.sprites')
171
 
                 self.console:watch('num enemies', 'the.enemies:count()')
172
166
                 --self.console:watch('drawTook', 'the.drawTook')
173
167
 
174
168
                 -- back off that dark overlay a bit
177
171
           end,
178
172
   onUpdate = function (self, dt)
179
173
                 if not (DEBUG and the.console.visible) then
180
 
                    if the.keys:justPressed('return') and the.keys:pressed('alt') then
181
 
                       love.graphics.toggleFullscreen()
 
174
                    if the.keys:justPressed('q') then
 
175
                       self.quit()
 
176
                    elseif the.keys:justPressed('return') then
 
177
                       if the.keys:pressed('alt') then
 
178
                          love.graphics.toggleFullscreen()
 
179
                       else
 
180
                          self.view = GameView:new()
 
181
                       end
182
182
                    elseif the.keys:justPressed('f1') then
183
183
                       local ss = love.graphics.newScreenshot()
184
184
                       ss:encode('screenshot-' ..love.timer.getTime()..'.png')