function Create(self)

	self.lifeTimer = Timer();
	--self.bounceTimer = Timer();
	self.detonate = false;
	self.lastVel = Vector(self.Vel.X,self.Vel.Y);
	self.LifeTime = 10000
end

function Update(self)

	if math.abs(self.lastVel.AbsRadAngle-self.Vel.AbsRadAngle) > 0.25 then
		--self.bounceTimer:Reset();
		self.Vel = Vector(self.lastVel.Magnitude,0):RadRotate(self.Vel.AbsRadAngle);
		local partAngle = 0.628318;
		for i = 1, 10 do
			local raycast = SceneMan:CastMORay(self.Pos,Vector(20,0):RadRotate(partAngle*i),0,self.Team,0,false,1);
			if raycast ~= 255 then
				local actor = MovableMan:GetMOFromID(MovableMan:GetMOFromID(raycast).RootID);
				if MovableMan:IsActor(actor) and ToActor(actor).Team ~= self.Team then
					self.detonate = true;
					break;
				end
			end
		end
	end
	self.lastVel = Vector(self.Vel.X,self.Vel.Y);


	--if self.bounceTimer:IsPastSimMS(200) or self.lifeTimer:IsPastSimMS(500) or self.detonate then
	if self.lifeTimer:IsPastSimMS(200) or self.detonate then
		local explosion = CreateMOSRotating("Particle Dummy Impulse Cannon Explosion");
		explosion.Pos = self.Pos;
		explosion:GibThis();
		MovableMan:AddParticle(explosion);
		self.ToDelete = true;
	else
		self.ToDelete = false;
	end

end
