/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:
91
91
                 the.storage.data = {highScore = 0}
92
92
              end
93
93
 
94
 
              the.rockColliders = Group:new()
 
94
              --the.rockColliders = Group:new()
95
95
              the.bullets = Group:new()
96
96
              the.mirrors = Group:new()
97
 
              the.rocks = Group:new()
 
97
              --the.rocks = Group:new()
98
98
              the.interface = Group:new()
 
99
              the.planets = Group:new()
99
100
 
100
101
              the.bg = Tile:new{
101
102
                 image = 'data/stars3.png',
105
106
              }
106
107
              self:add(the.bg)
107
108
 
 
109
              self:add(the.planets)
 
110
 
108
111
              --the.player = CrystalPlayer:new{x=400,y=300}
109
112
              the.player = SpacePlayer:new{x=1366,y=768}
110
113
              self:add(the.player)
113
116
              --self:add(Enemy:new{x=400, y=300})
114
117
 
115
118
              self:add(the.bullets)
116
 
              self:add(the.rockColliders)
 
119
              --self:add(the.rockColliders)
117
120
              self:add(the.mirrors)
118
 
              self:add(the.rocks)
 
121
              --self:add(the.rocks)
119
122
              self:add(the.interface)
120
123
 
 
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)
 
132
 
121
133
              the.cursor = Cursor:new()
122
134
              self:add(the.cursor)
123
135
 
175
187
              self.gameStart = love.timer.getTime()
176
188
           end,
177
189
   onUpdate = function(self, dt)
178
 
                 if the.player.active and love.timer.getTime() > self.lastRock + self.rockInterval then
 
190
                 if false and the.player.active and love.timer.getTime() > self.lastRock + self.rockInterval then
179
191
                    local unseenRock = nil
180
192
                    while not unseenRock do
181
193
                       local rock = Rock:new{
259
271
              math.randomseed(os.time())
260
272
 
261
273
              self.view = GameView:new()
 
274
 
 
275
              -- should fail silently if it can't go to fullscreen...
 
276
              love.graphics.toggleFullscreen()
 
277
 
262
278
              if DEBUG then
263
279
                 self.console:watch('VERSION', 'VERSION')
264
280
                 self.console:watch('updateTook', 'the.updateTook')
278
294
                 if the.keys:justPressed('q') then
279
295
                    self.quit()
280
296
                 elseif the.keys:justPressed('return') then
281
 
                    self.view = GameView:new()
 
297
                    if the.keys:pressed('alt') then
 
298
                       love.graphics.toggleFullscreen()
 
299
                    else
 
300
                       self.view = GameView:new()
 
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()
282
307
                 end
283
308
              end,
284
309
   update = function (self, dt)