mirror of
https://github.com/JonnyBro/beatrun.git
synced 2025-01-01 14:53:02 +05:00
checkpoint arrows
This commit is contained in:
parent
3e8139860e
commit
6176b706a1
3 changed files with 28 additions and 0 deletions
Binary file not shown.
|
@ -0,0 +1,7 @@
|
||||||
|
"UnlitGeneric"
|
||||||
|
{
|
||||||
|
$basetexture "medge/timetrial/arrow_02"
|
||||||
|
$translucent "1"
|
||||||
|
$vertexcolor "1"
|
||||||
|
$vertexalpha "1"
|
||||||
|
}
|
|
@ -77,6 +77,10 @@ local red = Color(255, 0, 0, 200)
|
||||||
local circlepos = Vector()
|
local circlepos = Vector()
|
||||||
local circleup = Vector(0, 0, 10000)
|
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()
|
function ENT:DrawTranslucent()
|
||||||
self:SetRenderBounds(minb, maxb)
|
self:SetRenderBounds(minb, maxb)
|
||||||
|
|
||||||
|
@ -96,6 +100,23 @@ function ENT:DrawTranslucent()
|
||||||
render.DrawBeam(newpos, newpos + circleup, 8, 0, 1, red, true)
|
render.DrawBeam(newpos, newpos + circleup, 8, 0, 1, red, true)
|
||||||
end
|
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()
|
-- local bmin, bmax = self:GetRenderBounds()
|
||||||
-- render.DrawWireframeBox(self:GetPos(), angle_zero, bmin, bmax)
|
-- render.DrawWireframeBox(self:GetPos(), angle_zero, bmin, bmax)
|
||||||
self.offset = self.offset + 0.00075
|
self.offset = self.offset + 0.00075
|
||||||
|
|
Loading…
Reference in a new issue