/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 02:52:56 UTC
  • Revision ID: josh@9ix.org-20130623025256-o80jq1o3hy8dw7lh
available cargo space

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)
176
171
           end,
177
172
   onUpdate = function (self, dt)
178
173
                 if not (DEBUG and the.console.visible) then
179
 
                    if the.keys:justPressed('return') and the.keys:pressed('alt') then
180
 
                       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
181
182
                    elseif the.keys:justPressed('f1') then
182
183
                       local ss = love.graphics.newScreenshot()
183
184
                       ss:encode('screenshot-' ..love.timer.getTime()..'.png')