function GunnerCreate(me)
	--SetHealth(me,5)
	SetHealth(me,math.random(2,6)) --Add in some spice
	SetPalette(me,8)
	SetPower(me,4)
end

function GunnerCollide(me, you)
	power = GetPower(you)
	TakeDamage(me, power)
end

function GunnerDeath(me)
	child = CreateObject(me,"Death", 0,11,1,false)
	SetSFX(child,true)
	MoveObject(child,16,0)
end

function GunnerUpdate(me)
	if IsPlaying(me,"Stand")
	then
 
		if PlayerDistanceX(me) < 128 and AnimationLoops(me) > 1
		and EndOfAnimation(me)
		then
			ChangeAnimation(me,"Shoot")
		end
	elseif IsPlaying(me,"Shoot")
	then
		if HitFrame(me, 3)
		then
			child = CreateObject(me, "Pellet",3,2,1,true)
			MoveObject(child,0,-12)
		end
		if EndOfAnimation(me) 
		then
			ChangeAnimation(me, "Stand")
		end
	end
	
end