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

Method PlayerSpawn

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

Source from the content-addressed store, hash-verified

190}
191
192void CEffects::PlayerSpawn(vec2 Pos, float Alpha, float Volume)
193{
194 for(int i = 0; i < 32; i++)
195 {
196 CParticle p;
197 p.SetDefault();
198 p.m_Spr = SPRITE_PART_SHELL;
199 p.m_Pos = Pos;
200 p.m_Vel = random_direction() * (std::pow(random_float(), 3) * 600.0f);
201 p.m_LifeSpan = random_float(0.3f, 0.6f);
202 p.m_StartSize = random_float(64.0f, 96.0f);
203 p.m_EndSize = 0.0f;
204 p.m_Rot = random_angle();
205 p.m_Rotspeed = random_float();
206 p.m_Gravity = random_float(-400.0f);
207 p.m_Friction = 0.7f;
208 p.m_Color = ColorRGBA(0xb5 / 255.0f, 0x50 / 255.0f, 0xcb / 255.0f, Alpha);
209 p.m_StartAlpha = Alpha;
210 GameClient()->m_Particles.Add(CParticles::GROUP_GENERAL, &p);
211 }
212 if(g_Config.m_SndGame)
213 GameClient()->m_Sounds.PlayAt(CSounds::CHN_WORLD, SOUND_PLAYER_SPAWN, Volume, Pos);
214}
215
216void CEffects::PlayerDeath(vec2 Pos, int ClientId, float Alpha)
217{

Callers 1

ProcessEventsMethod · 0.80

Calls 7

random_directionFunction · 0.85
random_floatFunction · 0.85
random_angleFunction · 0.85
SetDefaultMethod · 0.80
ColorRGBAClass · 0.70
AddMethod · 0.45
PlayAtMethod · 0.45

Tested by

no test coverage detected