/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-19 00:50:23 UTC
  • Revision ID: josh@9ix.org-20130619005023-necyd2i8kgqbp1s9
shield

Show diffs side-by-side

added added

removed removed

Lines of Context:
86
86
              the.interface = Group:new()
87
87
              the.planets = Group:new()
88
88
              the.indicators = Group:new()
89
 
              the.enemies = Group:new()
90
89
 
91
90
              the.bg = Tile:new{
92
91
                 image = 'data/stars3.png',
103
102
              self:add(the.player.thrust)
104
103
              self:add(the.player.shield)
105
104
 
106
 
              self:add(the.enemies)
107
 
 
108
105
              local e = Enemy:new{x=400, y=300}
109
106
              --local e = Enemy:new{x=the.bg.width / 2, y=the.bg.height / 2}
110
 
              the.enemies:add(e)
 
107
              self:add(e)
111
108
              self:add(e.thrust) -- why doesn't this work in Enemy.new?
112
 
              self:add(e.shield)
113
109
 
114
110
              self:add(the.bullets)
115
111
              self:add(the.indicators)
138
134
   onUpdate = function(self, dt)
139
135
                 the.bullets:collide(the.planets)
140
136
                 the.bullets:collide(the.player)
141
 
                 the.bullets:collide(the.enemies)
142
137
              end,
143
138
   onEndFrame = function(self)
144
139
                   the.interface.translate.x = the.player.x - the.app.width / 2 + the.player.width / 2