GroundEnemy = class(GullEnemy, function(o, x, y, world, ...)
	local arg = {...}
	if arg[1] == nil then
		options = {animation=snakeBlueAnimation, settingName='snake_', rate=80,  sizeScale=1, noFeathers=true}
	else
		options = arg[1]
	end
	GullEnemy.init(o, x, y, world, options)
	GroundEnemy.initialPosition(o)
	o.particleOffsetPosition = Vec2(26, 6)
	o.particleOffsetPosition:mult(r_scale*0.5)
end)

-- the ground enemy just moves along the ground, so we just need to find the centerpoint of the building
function GroundEnemy:initialPosition()
	-- find the building center
	local rootCenter = Vec2(self.world.rootRoom.pos.x+self.world.rootRoom.w, self.world.rootRoom.pos.y+self.world.rootRoom.h)
	local limits = self.world:getTowerLimits()
	limits.min = Vec2(limits.minX, limits.minY)
	limits.max = Vec2(limits.maxX, limits.maxY)
	local maxSize = limits.min:distance(limits.max)
	self.pos.y = rootCenter.y-self.h

	if math.random() > 0.5 then
		self.pos.x=maxSize*2
	else
		self.pos.x=-maxSize*2
	end
	self.velocity.y = 0
	if self.pos.x < rootCenter.x then
		self.flip = 0
		self.velocity.x = game_settings[self.settingName.."speed"] or game_settings["snake_speed"]
	else
		self.flip = 1
		self.velocity.x = -(game_settings[self.settingName.."speed"] or game_settings[self.settingName.."speed"] or game_settings["snake_speed"])
	end
	self.velocity:mult(r_scale*0.5)
end

GroundMountainEnemy = class(GroundEnemy, function(o, x, y, world)
	GroundEnemy.init(o, x, y, world, {animation=snakeOrangeAnimation, settingName='snake_orange_', rate=41,  sizeScale=1, noFeathers=true})
	GroundEnemy.initialPosition(o)
end)

GroundMarsEnemy = class(GroundEnemy, function(o, x, y, world)
	GroundEnemy.init(o, x, y, world, {animation=snakeGreenAnimation, settingName='snake_green_', rate=41,  sizeScale=1, noFeathers=true})
	GroundEnemy.initialPosition(o)
end)

GroundRatEnemy = class(GroundEnemy, function(o, x, y, world)
	GroundEnemy.init(o, x, y, world, {animation=ratAnimation, settingName='rat_', rate=41,  sizeScale=1, noFeathers=true})
	GroundEnemy.initialPosition(o)
	o.particleOffsetPosition = Vec2(46, 50)
	o.particleOffsetPosition:mult(r_scale*0.5)
end)

GroundRatGreenEnemy = class(GroundEnemy, function(o, x, y, world)
	GroundEnemy.init(o, x, y, world, {animation=ratGreenAnimation, settingName='rat_green_', rate=41,  sizeScale=1, noFeathers=true})
	GroundEnemy.initialPosition(o)
	o.particleOffsetPosition = Vec2(46, 50)
	o.particleOffsetPosition:mult(r_scale*0.5)
end)