function howitzer.init()

 local gun_barrel_1 = load_particle("howitzer_barrel_1.obj")
 local gun_barrel_2 = load_particle("howitzer_barrel_2.obj")
 local gun_barrel_3 = load_particle("howitzer_barrel_3.obj")


 local flare_glow = load_particle("howitzer_glow.obj")

 function howitzer.gun(worm)

  local angle = worm:angle()

  local barrel_1_fwd = worm:shoot(gun_barrel_1, 1, 0, 0, 0, 0, 0, 30, 2)
  local barrel_2_fwd = worm:shoot(gun_barrel_2, 1, 0, 0, 0, 0, 0, 0, 2)
  local barrel_3_fwd = worm:shoot(gun_barrel_3, 1, 0, 0, 0, 0, 0, -30, 2)

  local barrel_1_bwd = worm:shoot(gun_barrel_1, 1, 0, 0, 0, 0, 0, 30, 2)
  local barrel_2_bwd = worm:shoot(gun_barrel_2, 1, 0, 0, 0, 0, 0, 0, 2)
  local barrel_3_bwd = worm:shoot(gun_barrel_3, 1, 0, 0, 0, 0, 0, -30, 2)



  local w = worm:current_weapon()

  local position

  if w:is_reloading() then
   position = 5-w:reload_time() * 0.025
  else
   position = 5
  end

  local dx, dy = angle_vector(angle,1)

  barrel_1_fwd:set_spd(dx*(position), dy*(position))
  barrel_2_fwd:set_spd(dx*(position), dy*(position))
  barrel_3_fwd:set_spd(dx*(position), dy*(position))

  barrel_1_bwd:set_spd(dx*(position-7), dy*(position-7))
  barrel_2_bwd:set_spd(dx*(position-7), dy*(position-7))
  barrel_3_bwd:set_spd(dx*(position-7), dy*(position-7))


 end

 function howitzer.flare(object)
  local time = object:data().time
  if time then
   object:data().time = time + 0.1
  else
   object:data().time = 1.2
   time = 0
  end
  object:shoot(flare_glow, 25, 0.1, 0.1, 0, 0, 360, 0, 0.1*math.random(0,30)*math.sin(time))
 end

end
