/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:
18
18
require 'boom'
19
19
require 'planet'
20
20
require 'trade_view'
 
21
require 'shield'
21
22
 
22
23
util = {
23
24
   signOf = function(value)
99
100
              the.player = SpacePlayer:new{x=the.bg.width / 2, y=the.bg.height / 2}
100
101
              self:add(the.player)
101
102
              self:add(the.player.thrust)
 
103
              self:add(the.player.shield)
102
104
 
103
 
              self:add(Enemy:new{x=400, y=300})
 
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?
104
109
 
105
110
              self:add(the.bullets)
106
111
              self:add(the.indicators)
128
133
           end,
129
134
   onUpdate = function(self, dt)
130
135
                 the.bullets:collide(the.planets)
 
136
                 the.bullets:collide(the.player)
131
137
              end,
132
138
   onEndFrame = function(self)
133
139
                   the.interface.translate.x = the.player.x - the.app.width / 2 + the.player.width / 2