Skip to content
This repository
Browse code

Placement of owned turrets now varies.

  • Loading branch information...
commit f990817cf031863bbcc8349a6fc1bfc91576a7d8 1 parent 7d2d0c1
DMB Textmode authored

Showing 2 changed files with 12 additions and 6 deletions. Show diff stats Hide diff stats

  1. +8 5 hull/turret.lua
  2. +4 1 powerup.lua
13 hull/turret.lua
@@ -24,11 +24,14 @@ end
24 24
25 25 function _M:think(dt)
26 26 if e.owner then
27   - self.facing = e.owner.facing
28   - self.shooting = e.owner.shooting
29   -
30   - self.pos_x = e.owner.pos_x - 10
31   - self.pos_y = e.owner.pos_y - 10
  27 + local own = e.owner
  28 + self.facing = own.facing
  29 + self.shooting = own.shooting
  30 + self.shot_rate = own.shot_rate*2 -- thats half the firing rate
  31 +
  32 + local theta, d = self.hardpoint, 16
  33 + self.pos_x = own.pos_x + math.cos(theta) * d
  34 + self.pos_y = own.pos_y + math.sin(theta) * d
32 35 else
33 36 self.facing = math.random
34 37 self.shooting = true
5 powerup.lua
@@ -73,7 +73,10 @@ function _M:doeffect(e)
73 73 elseif self.effect == 'heal100' then
74 74 e:heal(e.shieldmax*impact)
75 75 elseif self.effect == 'turret' then
76   - e:addentity(turret.new{owner = e})
  76 + local t = turret.new{owner = e}
  77 + e:addentity(t)
  78 + local tau = math.pi*2
  79 + t.hardpoint = math.random() * tau
77 80 else
78 81 print("Unknown powerup effect", self.effect)
79 82 end

0 comments on commit f990817

Please sign in to comment.
Something went wrong with that request. Please try again.