/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-09 23:09:16 UTC
  • Revision ID: josh@9ix.org-20130609230916-jdtvrn226f3vnijm
add planet, remove rocks

Show diffs side-by-side

added added

removed removed

Lines of Context:
100
100
 
101
101
              the.bg = Tile:new{
102
102
                 image = 'data/stars3.png',
103
 
                 width = 13660,
104
 
                 height = 7680
 
103
                 -- 1366x768 * 3
 
104
                 width = 4098,
 
105
                 height = 2304
105
106
              }
106
107
              self:add(the.bg)
107
108
 
120
121
              --self:add(the.rocks)
121
122
              self:add(the.interface)
122
123
 
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
 
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)
134
132
 
135
133
              the.cursor = Cursor:new()
136
134
              self:add(the.cursor)
286
284
                 self.console:watch('the.app.height', 'the.app.height')
287
285
                 self.console:watch('num mirrors', '#the.mirrors.sprites')
288
286
                 self.console:watch('num rocks', '#the.rocks.sprites')
289
 
                 self.console:watch('num planets', '#the.planets.sprites')
290
287
                 --self.console:watch('drawTook', 'the.drawTook')
291
288
 
292
289
                 -- back off that dark overlay a bit
294
291
              end
295
292
           end,
296
293
   onUpdate = function (self, dt)
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
 
294
                 if the.keys:justPressed('q') then
 
295
                    self.quit()
 
296
                 elseif the.keys:justPressed('return') then
 
297
                    if the.keys:pressed('alt') then
310
298
                       love.graphics.toggleFullscreen()
 
299
                    else
 
300
                       self.view = GameView:new()
311
301
                    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()
312
307
                 end
313
308
              end,
314
309
   update = function (self, dt)