/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-10-21 18:10:48 UTC
  • Revision ID: josh@9ix.org-20131021181048-03jg7enu0pu4mmco
recharge shields automatically for free, remove bandit bounty

Show diffs side-by-side

added added

removed removed

Lines of Context:
22
22
require 'pause_view'
23
23
require 'game_over'
24
24
require 'names'
 
25
require 'good'
25
26
 
26
27
util = {
27
28
   signOf = function(value)
61
62
                 the.storage.data = {planets = {}}
62
63
 
63
64
                 -- build planets from random
64
 
                 for _ = 1, math.random(3, 6) do
 
65
                 for _ = 1, math.random(5, 7) do
65
66
                    local planet = Planet:new{
66
67
                       x = math.random(the.app.width / 2,
67
68
                                       the.bg.width - the.app.width / 2),
79
80
                                 })
80
81
                 end
81
82
 
 
83
                 Good:stockPlanets()
 
84
 
82
85
                 -- build fresh player
83
86
                 local player = SpacePlayer:new{x=the.bg.width / 2, y=the.bg.height / 2}
84
87
                 the.player = player
168
171
}
169
172
 
170
173
the.app = App:new {
 
174
   name = 'Traderous',
171
175
   onRun = function (self)
172
176
              print('Version: ' .. VERSION)
173
177
 
186
190
                 self.console:watch('num rocks', '#the.rocks.sprites')
187
191
                 self.console:watch('num planets', '#the.planets.sprites')
188
192
                 self.console:watch('num enemies', 'the.enemies:count()')
 
193
                 self.console:watch('onPlanet', 'the.player.onPlanet')
 
194
                 self.console:watch('kills', 'the.player.kills')
189
195
                 --self.console:watch('drawTook', 'the.drawTook')
190
196
 
191
197
                 -- back off that dark overlay a bit