Permalink
Browse files

player_bullet -> bullet

  • Loading branch information...
1 parent 8692dce commit 477292eec8f4cee6d29a160ce3e30ba49d1dd203 Scott Robinson committed Mar 16, 2012
Showing with 8 additions and 8 deletions.
  1. +2 −2 invader.lua
  2. +2 −2 swarm.lua
  3. +4 −4 world.lua
View
@@ -35,15 +35,15 @@ local function colliding(ibox, bbox)
end
local Invader = function(...)
- local function constructor(n, sx, sy, player_bullet)
+ local function constructor(n, sx, sy, bullet)
local col = n % Consts.invader.columns
local row = math.floor(n / Consts.invader.columns)
_x = (col * (Consts.invader.side * Consts.invader.y_spacing)) + sx
_y = (row * (Consts.invader.side * Consts.invader.x_spacing)) + sy
_box = L(box)(_x, _y)
- _hit = L(colliding)(_box, player_bullet._box)
+ _hit = L(colliding)(_box, bullet._box)
_alive = true
local function die(when)
View
@@ -14,14 +14,14 @@ local function draw_list(invaders, x, y)
end
local Swarm = function(...)
- local function constructor(ix, iy, iv, player_bullet)
+ local function constructor(ix, iy, iv, bullet)
_v = iv
_x = ix + S(_v)
_y = iy
local invaders = __.range(0, Consts.invader.rows * Consts.invader.columns - 1)
:map(function(n)
- return Invader(n, _x, _y, player_bullet)
+ return Invader(n, _x, _y, bullet)
end)
_bounced = __.reduce(invaders, false, function(c, i)
View
@@ -7,13 +7,13 @@ local Player = require 'player'
local Swarm = require 'swarm'
return function()
- local player_bullet = Bullet(-1, -1, Consts.bullet.v)
+ local bullet = Bullet(-1, -1, Consts.bullet.v)
local swarm = Swarm((Consts.screen.width / 2) -
((Consts.invader.side * Consts.invader.x_spacing) * Consts.invader.columns) / 2,
Consts.invader.side,
Consts.invader.speed,
- player_bullet)
+ bullet)
local player = Player(Consts.screen.width / 2,
Consts.screen.height - Consts.player.height - 1,
@@ -22,12 +22,12 @@ return function()
link('key.right', player.right)
local function shoot()
- player_bullet.shoot(player._x(), player._y() - Consts.bullet.height / 2)
+ bullet.shoot(player._x(), player._y() - Consts.bullet.height / 2)
end
link('key. ', shoot)
link('key.up', shoot)
- __.extend(Screen, {player_bullet, swarm, player})
+ __.extend(Screen, {bullet, swarm, player})
await('key.escape')
end

0 comments on commit 477292e

Please sign in to comment.