MCPcopy Create free account
hub / github.com/ddnet/ddnet / SmokeTrail

Method SmokeTrail

src/game/client/components/effects.cpp:125–143  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

123}
124
125void CEffects::SmokeTrail(vec2 Pos, vec2 Vel, float Alpha, float TimePassed)
126{
127 if(!m_Add50hz && TimePassed < 0.001f)
128 return;
129
130 CParticle p;
131 p.SetDefault();
132 p.m_Spr = SPRITE_PART_SMOKE;
133 p.m_Pos = Pos;
134 p.m_Vel = Vel + random_direction() * 50.0f;
135 p.m_LifeSpan = random_float(0.5f, 1.0f);
136 p.m_StartSize = random_float(12.0f, 20.0f);
137 p.m_EndSize = 0.0f;
138 p.m_Friction = 0.7f;
139 p.m_Gravity = random_float(-500.0f);
140 p.m_Color.a = Alpha;
141 p.m_StartAlpha = Alpha;
142 GameClient()->m_Particles.Add(CParticles::GROUP_PROJECTILE_TRAIL, &p, TimePassed);
143}
144
145void CEffects::SkidTrail(vec2 Pos, vec2 Vel, int Direction, float Alpha, float Volume)
146{

Callers 2

RenderProjectileMethod · 0.80
ReconstructSmokeTrailMethod · 0.80

Calls 4

random_directionFunction · 0.85
random_floatFunction · 0.85
SetDefaultMethod · 0.80
AddMethod · 0.45

Tested by

no test coverage detected