/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 01:06:14 UTC
  • Revision ID: josh@9ix.org-20130619010614-j3rbcv1c0my2tw0f
enemy shields and death

Show diffs side-by-side

added added

removed removed

Lines of Context:
105
105
 
106
106
              self:add(the.enemies)
107
107
 
108
 
              for _ = 1, 5 do
109
 
                 local e = Enemy:new{x = math.random(the.bg.width),
110
 
                                     y = math.random(the.bg.height)}
111
 
                 --local e = Enemy:new{x=the.bg.width / 2, y=the.bg.height / 2}
112
 
                 the.enemies:add(e)
113
 
                 self:add(e.thrust) -- why doesn't this work in Enemy.new?
114
 
                 self:add(e.shield)
115
 
              end
 
108
              local e = Enemy:new{x=400, y=300}
 
109
              --local e = Enemy:new{x=the.bg.width / 2, y=the.bg.height / 2}
 
110
              the.enemies:add(e)
 
111
              self:add(e.thrust) -- why doesn't this work in Enemy.new?
 
112
              self:add(e.shield)
116
113
 
117
114
              self:add(the.bullets)
118
115
              self:add(the.indicators)
119
116
              self:add(the.interface)
120
117
 
121
 
              for _ = 1, math.random(3, 6) do
 
118
              for _ = 1, math.random(6) do
122
119
                 local planet = Planet:new{
123
120
                    x = math.random(the.app.width / 2,
124
121
                                    the.bg.width - the.app.width / 2),
132
129
              the.cursor = Cursor:new()
133
130
              self:add(the.cursor)
134
131
 
135
 
              the.over = Text:new{
136
 
                 y = the.app.height / 2,
137
 
                 width = the.app.width,
138
 
                 align = 'center',
139
 
                 font = 25,
140
 
                 text = "Game Over",
141
 
                 visible = false
142
 
              }
143
 
              the.interface:add(the.over)
144
 
 
145
 
 
146
 
              the.instructions = Text:new{
147
 
                 y = the.app.height / 2 + 32,
148
 
                 width = the.app.width,
149
 
                 align = 'center',
150
 
                 font = 12,
151
 
                 text = "Press Enter to start a new game\nPress Q to quit",
152
 
                 visible = false
153
 
              }
154
 
              the.interface:add(the.instructions)
155
 
 
156
132
              love.mouse.setGrab(true)
157
133
              love.mouse.setVisible(false)
158
134
              love.mouse.setPosition(the.app.width / 2, the.app.height / 2)