function Creep(limit, level, type)
{
	this.limit = limit;
	this.type = type ? type : 1;
	
	this.reset();
	this.creep = true;
	this.speed = Level.creep[this.type].speed * (1 + (level-1)*0.01);
	this.maxLife = this.life = Level.creep[this.type].life * (1 + (level-1)*0.1);
	
	if (this.speed > maxSpeed) this.speed = maxSpeed;
}

Creep.prototype.reset = function()
{
	var limit = this.limit;
	var b = new Base();
	b.scaleX = b.scaleY = b.scaleZ = 0.25;
	this.life = this.maxLife;
	this.base = b;
}

Creep.prototype.getPoint = function()
{
	return 20;
}

Creep.prototype.getMoney = function()
{
	return 2;
}

Creep.prototype.setProperty = function(coord)
{
	var b = this.base;
	
	var axis = ['x', 'y', 'z'];
	for (var i = 0; i < 3; i++)
	{
		b[axis[i]] = coord[axis[i]]*Util.scale;
	}
}

Creep.prototype.step = function(goal)
{
	var rdm = this.lock;
	var b = this.base;
	const mv = this.speed;
	const th = 0.01;
	const min = 0.125;
	
	b.scaleX = b.scaleY = b.scaleZ = (0.25 - min) / (this.maxLife/this.life) + min;
	
	Util.moveOptimal(this, goal, limit, mv)
	
	this.base.rotZ += 1;
	if (this.base.rotZ > 360) this.base.rotZ -= 360;
}

Creep.prototype.returnPolygons = function()
{
	var ar = [];
	
	return ar;
}