function Gunner2:Create(me)
	SetHealth(me,8)	
	SetPower(me,0)
	ChangeAnimation(me,"Stand")
end

function Gunner2:Update(me)
	local playerX = GetPlayerX(me)
	local playerY = GetPlayerY(me)
	
	local playerDistance = PlayerDistanceX(me)

	if playerDistance <= 150
	then
		if self.proximityAlert == false
		then
			self.proximityAlert = true
			self.lifetime = GetLifetime(me)

			myX = GetPosX(me)
			myY = GetPosY(me)

			self.targetY = myY

			if myX > playerX
			then
				self.targetX = playerX - 180
			else	
				self.targetX = playerX + 180
			end
		end

		local currLifetime = GetLifetime(me)

		local deltaLifetime = currLifetime - self.lifetime

		if deltaLifetime >= 8
		then
			if TeleportToTarget(me, self.targetX, self.targetY) == true
			then
				CreateEmitter("TeleportFX", myX, myY)
				CreateEmitter("TeleportFX2", self.targetX, self.targetY)
			else
				self.targetX = GetPosX(me)
				self.targetY = GetPosY(me)
			end

			self.proximityAlert = false
		end
	end
end