/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-25 16:59:14 UTC
  • Revision ID: josh@9ix.org-20130625165914-egx7p44y1v0ulwyj
pause screen

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'
22
23
 
23
24
util = {
24
25
   signOf = function(value)
117
118
              self.focus = the.player
118
119
           end,
119
120
   onUpdate = function(self, dt)
 
121
                 if the.keys:justPressed('escape') then
 
122
                    PauseView:new():activate()
 
123
                 end
 
124
 
120
125
                 the.bullets:collide(the.planets)
121
126
                 the.bullets:collide(the.player)
122
127
                 the.bullets:collide(the.enemies)
171
176
           end,
172
177
   onUpdate = function (self, dt)
173
178
                 if not (DEBUG and the.console.visible) then
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
 
179
                    if the.keys:justPressed('return') and the.keys:pressed('alt') then
 
180
                       love.graphics.toggleFullscreen()
182
181
                    elseif the.keys:justPressed('f1') then
183
182
                       local ss = love.graphics.newScreenshot()
184
183
                       ss:encode('screenshot-' ..love.timer.getTime()..'.png')