/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-26 01:33:26 UTC
  • Revision ID: josh@9ix.org-20130626013326-k5uawz75pw2ujunu
s/spacey/spacey-nova/ (still need a real name...)

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