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

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

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

function GunnerUpdate(me)

	--Begin firing once animation is complete
	if IsPlaying(me,"Stand")
	then
 
		if PlayerDistanceX(me) < 128 and AnimationLoops(me) > 1
		and EndOfAnimation(me)
		then
			ChangeAnimation(me,"Shoot")
		end
	--Already firing?
	elseif IsPlaying(me,"Shoot")
	then
		--Shoot the bullet
		if HitFrame(me, 3)
		then
			child = CreateObject(me, "Bullet","EnemyWeapons",3,13,1,true)
			MoveObject(child,0,-13)
		end
		--Stop Firing
		if EndOfAnimation(me) 
		then
			ChangeAnimation(me, "Stand")
		end
	end
	
end