YetiEnemy = class(KidEnemy, function(o, x, y, world)
	KidEnemy.init(o, x, y, world, {runAnimation=yetiRunAnimation, hitAnimation=yetiHitAnimation, settingName='yeti_'})
end)

function YetiEnemy:update()
	if self.particles then self.particles:update(bludG.elapsed) end
	if Enemy.isFrozen(self) then return end
	self.sprite = self.currentAnimation:getSprite()
	self.acceleration.x = 0;
	self.hittingRoom = nil
	-- run a check to see if we are touching a room
	local touchingRoom = false
	self.hittingRoom = false
	if self.touching.other then
		for i,v in ipairs(self.touching.other) do
			if v:is_a(Room) then touchingRoom = v; break; end
		end
	end
	if touchingRoom and touchingRoom.alive then
		self.hittingRoom = touchingRoom
		self.currentAnimation = self.hitAnimation
		if self.touching.LEFT then self.flip = 1 else self.flip = 0 end
	else
		self.currentAnimation = self.runAnimation
		if self.world.rootRoom:center().x < self:center().x then
			self.flip = 1
			self.acceleration.x = -self.x_speed
		elseif self.world.rootRoom:center().x > self:center().x then
			self.flip = 0
			self.acceleration.x = self.x_speed
		end
		Enemy.update(self)
		-- bang the kid off the groundplane, and the building, and the other enemies
		self.world.groundPlane:overlap(self, nil, Object.separate)
		self.world.rooms:overlap(self, nil, Object.separate)
	end
end

YetiAngryEnemy = class(KidEnemy, function(o, x, y, world)
	KidEnemy.init(o, x, y, world, {runAnimation=yetiRunAnimation, hitAnimation=yetiHitAnimation, settingName='yeti_angry_', tint={255, 100, 100}})
end)

function YetiAngryEnemy:update()
	YetiEnemy.update(self)
end
