File tree Expand file tree Collapse file tree 2 files changed +6
-2
lines changed
Expand file tree Collapse file tree 2 files changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -153,10 +153,12 @@ class Game
153153 . disable_project = not . disable_project
154154 false
155155
156- mousepressed : ( x, y) =>
156+ mousepressed : ( x, y, btn ) =>
157157 x, y = @world . viewport\ unproject x, y
158158 -- @world.particles\add EnergyEmitter @world, x,y
159- -- @world.entities\add Energy x,y
159+
160+ if btn == " r"
161+ @world . entities\ add Energy x, y
160162 -- print "boom: #{x}, #{y}"
161163 -- @world.particles\add Explosion @world, x,y
162164
Original file line number Diff line number Diff line change @@ -185,6 +185,8 @@ class Player extends Tank
185185
186186 enemy_killed : ( thing, world) =>
187187 @score += thing. score if thing. score
188+ if math.random ! > 0.5
189+ world. entities\ add Energy thing. x, thing. y
188190
189191 draw : =>
190192 super !
You can’t perform that action at this time.
0 commit comments