/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-16 04:21:01 UTC
  • Revision ID: josh@9ix.org-20130616042101-tp1rddbd3subc8lg
enemy is back

Show diffs side-by-side

added added

removed removed

Lines of Context:
18
18
require 'boom'
19
19
require 'planet'
20
20
require 'trade_view'
21
 
require 'shield'
22
21
 
23
22
util = {
24
23
   signOf = function(value)
100
99
              the.player = SpacePlayer:new{x=the.bg.width / 2, y=the.bg.height / 2}
101
100
              self:add(the.player)
102
101
              self:add(the.player.thrust)
103
 
              self:add(the.player.shield)
104
102
 
105
 
              local e = Enemy:new{x=400, y=300}
106
 
              --local e = Enemy:new{x=the.bg.width / 2, y=the.bg.height / 2}
107
 
              self:add(e)
108
 
              self:add(e.thrust) -- why doesn't this work in Enemy.new?
 
103
              self:add(Enemy:new{x=400, y=300})
109
104
 
110
105
              self:add(the.bullets)
111
106
              self:add(the.indicators)
133
128
           end,
134
129
   onUpdate = function(self, dt)
135
130
                 the.bullets:collide(the.planets)
136
 
                 the.bullets:collide(the.player)
137
131
              end,
138
132
   onEndFrame = function(self)
139
133
                   the.interface.translate.x = the.player.x - the.app.width / 2 + the.player.width / 2