function Create(self)
    --The speed to maintain.
    self.speed = 10;
    
    --The explosion time, in milliseconds.
    self.fuse = 1500;
    
    --Timer for detonation.
    self.detTimer = Timer();
end

function Update(self)
    self.Vel = Vector(self.Vel.X, self.Vel.Y):SetMagnitude(self.speed);
    
    --Detonate by fuse.
    if self.detTimer:IsPastSimMS(self.fuse) then
        self:GibThis();
    end
    
    --Detonate on impact.
    local moid = SceneMan:CastMORay(self.Pos, self.Vel * TimerMan.DeltaTimeSecs * 20, 0, self.Team, 0, true, 1);
    if moid ~= 0 and moid ~= 255 then
        local hitPos = Vector();
        SceneMan:CastFindMORay(self.Pos, self.Vel * TimerMan.DeltaTimeSecs * 20, moid, hitPos, 0, true, 1);
        self.Pos = hitPos;
        self:GibThis();
    end
end