diff --git a/beatrun/gamemodes/beatrun/content/materials/medge/timetrial/arrow_02.vtf b/beatrun/gamemodes/beatrun/content/materials/medge/timetrial/arrow_02.vtf new file mode 100644 index 0000000..2797472 Binary files /dev/null and b/beatrun/gamemodes/beatrun/content/materials/medge/timetrial/arrow_02.vtf differ diff --git a/beatrun/gamemodes/beatrun/content/materials/medge/timetrial/checkpoint_arrow.vmt b/beatrun/gamemodes/beatrun/content/materials/medge/timetrial/checkpoint_arrow.vmt new file mode 100644 index 0000000..56ad55c --- /dev/null +++ b/beatrun/gamemodes/beatrun/content/materials/medge/timetrial/checkpoint_arrow.vmt @@ -0,0 +1,7 @@ +"UnlitGeneric" +{ + $basetexture "medge/timetrial/arrow_02" + $translucent "1" + $vertexcolor "1" + $vertexalpha "1" +} \ No newline at end of file diff --git a/beatrun/gamemodes/beatrun/entities/entities/tt_cp/shared.lua b/beatrun/gamemodes/beatrun/entities/entities/tt_cp/shared.lua index e17e92b..9e50eb1 100644 --- a/beatrun/gamemodes/beatrun/entities/entities/tt_cp/shared.lua +++ b/beatrun/gamemodes/beatrun/entities/entities/tt_cp/shared.lua @@ -77,6 +77,10 @@ local red = Color(255, 0, 0, 200) local circlepos = Vector() local circleup = Vector(0, 0, 10000) +local checkheight = Vector(0, 0, 64) -- eyepos diff +local arrow = Material("medge/timetrial/checkpoint_arrow") +local asize = 32 + function ENT:DrawTranslucent() self:SetRenderBounds(minb, maxb) @@ -96,6 +100,23 @@ function ENT:DrawTranslucent() render.DrawBeam(newpos, newpos + circleup, 8, 0, 1, red, true) end + local nextCP = Checkpoints[self:GetCPNum() + 1] or self + + local selfpos = self:GetPos() + checkheight + local fwAng = (nextCP:GetPos() - selfpos):GetNormalized():Angle() + + for i = 0, 1, 0.1 do + local prog = (SysTime() * .25) % 0.1 + i + + red.a = 255 * (prog > 0.5 and 0.5 - prog or prog) * 2 + + local size = asize * (1 - prog) + local pos = selfpos - fwAng:Forward() * asize + fwAng:Forward() * (asize * 2) * prog + + render.SetMaterial(arrow) + render.DrawBeam(pos - fwAng:Forward() * size * .5, pos + fwAng:Forward() * size * .5, size, 1, 0, red) + end + -- local bmin, bmax = self:GetRenderBounds() -- render.DrawWireframeBox(self:GetPos(), angle_zero, bmin, bmax) self.offset = self.offset + 0.00075