function init()
	gun.name = "Spikes"
	gun.fireDelay = 2500
	gun.shotrange = 400
	gun.shotspeed = 900
	gun.shotdamage = .3
	gun.shotknockback = 500
	gun.burstNum = 12
	gun.burstDelay = 70
	
	--make it always a turret
	gun.fixed = 3
	
	gun.skipUpdate = 0--calls the lua gun update function
	return 0
end


function update()
	--continuously track the target
	if ship.controller.hasTarget() == 1 then
		gun.burstX = ship.controller.target.x
		gun.burstY = ship.controller.target.y
	end
	
	--make the spikes gfx, attach it to the owner
	if gun.vars.get("madespikes") == 0 then
		stage.createEmitter("spikes", gun.owner.x, gun.owner.y)
		emitter.upload()
		
		gun.vars.set("madespikes", 1)
	end

	return 0
end


function fire()
	gun.addShot("barb.png", gun.firex, gun.firey, gun.firetheta)

	--attach a trail emitter to the shot

	--playSFX(getSound("gun_pew1.wav"),owner.x,owner.y)

	return 0
end

function shot_update()

	return 0
end