/traderous

To get this branch, use:
bzr branch /bzr/traderous

« back to all changes in this revision

Viewing changes to main.lua

  • Committer: Josh C
  • Date: 2013-06-10 21:37:59 UTC
  • Revision ID: josh@9ix.org-20130610213759-drnecjpritehmz3t
bigger area, more planets

Show diffs side-by-side

added added

removed removed

100
100
 
101
101
              the.bg = Tile:new{
102
102
                 image = 'data/stars3.png',
103
 
                 -- 1366x768 * 3
104
 
                 width = 4098,
105
 
                 height = 2304
 
103
                 width = 13660,
 
104
                 height = 7680
106
105
              }
107
106
              self:add(the.bg)
108
107
 
121
120
              --self:add(the.rocks)
122
121
              self:add(the.interface)
123
122
 
124
 
              local planet = Tile:new{
125
 
                 image = 'data/planet1.png',
126
 
                 x = math.random(the.app.width / 2,
127
 
                                 the.bg.width - the.app.width / 2),
128
 
                 y = math.random(the.app.height / 2,
129
 
                                 the.bg.height - the.app.height / 2),
130
 
              }
131
 
              the.planets:add(planet)
 
123
              for _ = 1, math.random(6) do
 
124
                 local planet = Tile:new{
 
125
                    image = 'data/planet1.png',
 
126
                    x = math.random(the.app.width / 2,
 
127
                                    the.bg.width - the.app.width / 2),
 
128
                    y = math.random(the.app.height / 2,
 
129
                                    the.bg.height - the.app.height / 2),
 
130
                    rotation = math.random() * math.pi
 
131
                 }
 
132
                 the.planets:add(planet)
 
133
              end
132
134
 
133
135
              the.cursor = Cursor:new()
134
136
              self:add(the.cursor)
284
286
                 self.console:watch('the.app.height', 'the.app.height')
285
287
                 self.console:watch('num mirrors', '#the.mirrors.sprites')
286
288
                 self.console:watch('num rocks', '#the.rocks.sprites')
 
289
                 self.console:watch('num planets', '#the.planets.sprites')
287
290
                 --self.console:watch('drawTook', 'the.drawTook')
288
291
 
289
292
                 -- back off that dark overlay a bit
291
294
              end
292
295
           end,
293
296
   onUpdate = function (self, dt)
294
 
                 if the.keys:justPressed('q') then
295
 
                    self.quit()
296
 
                 elseif the.keys:justPressed('return') then
297
 
                    if the.keys:pressed('alt') then
 
297
                 if not (DEBUG and the.console.visible) then
 
298
                    if the.keys:justPressed('q') then
 
299
                       self.quit()
 
300
                    elseif the.keys:justPressed('return') then
 
301
                       if the.keys:pressed('alt') then
 
302
                          love.graphics.toggleFullscreen()
 
303
                       else
 
304
                          self.view = GameView:new()
 
305
                       end
 
306
                    elseif the.keys:justPressed('f1') then
 
307
                       local ss = love.graphics.newScreenshot()
 
308
                       ss:encode('screenshot-' ..love.timer.getTime()..'.png')
 
309
                    elseif the.keys:justPressed('f11') then
298
310
                       love.graphics.toggleFullscreen()
299
 
                    else
300
 
                       self.view = GameView:new()
301
311
                    end
302
 
                 elseif the.keys:justPressed('f1') then
303
 
                    local ss = love.graphics.newScreenshot()
304
 
                    ss:encode('screenshot-' ..love.timer.getTime()..'.png')
305
 
                 elseif the.keys:justPressed('f11') then
306
 
                    love.graphics.toggleFullscreen()
307
312
                 end
308
313
              end,
309
314
   update = function (self, dt)