/traderous

To get this branch, use:
bzr branch /bzr/traderous

« back to all changes in this revision

Viewing changes to main.lua

  • Committer: Josh C
  • Date: 2013-06-19 01:06:14 UTC
  • Revision ID: josh@9ix.org-20130619010614-j3rbcv1c0my2tw0f
enemy shields and death

Show diffs side-by-side

added added

removed removed

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