Skip to content

Instantly share code, notes, and snippets.

@GermanAizek
Last active October 18, 2020 02:49
Show Gist options
  • Save GermanAizek/75c6906df59b942806ad101e6f3c998c to your computer and use it in GitHub Desktop.
Save GermanAizek/75c6906df59b942806ad101e6f3c998c to your computer and use it in GitHub Desktop.
cop_explosion.lua
local mat = Material("sprites/stalker_cop/ani_explo")
function EFFECT:Init(data)
local origin = data:GetOrigin()
local angles = data:GetAngles()
self.Time = 0
self.Data = data
ParticleEffect("cop_rgd_explosion", origin, angles)
end
function EFFECT:Think()
self.Time = self.Time + FrameTime()
if self.Time >= 1 then
return false
end
return true
end
function EFFECT:Render()
local t = math.floor(self.Time * 55)
render.SetMaterial(mat)
mat:SetInt("$frame", t)
render.DrawSprite(self:GetPos(), 144, 144)
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment