Last active
October 18, 2020 02:49
-
-
Save GermanAizek/75c6906df59b942806ad101e6f3c998c to your computer and use it in GitHub Desktop.
cop_explosion.lua
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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