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

Method PowerupShine

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

Source from the content-addressed store, hash-verified

53}
54
55void CEffects::PowerupShine(vec2 Pos, vec2 Size, float Alpha)
56{
57 if(!m_Add50hz)
58 return;
59
60 CParticle p;
61 p.SetDefault();
62 p.m_Spr = SPRITE_PART_SLICE;
63 p.m_Pos = Pos + vec2(random_float(-0.5f, 0.5f), random_float(-0.5f, 0.5f)) * Size;
64 p.m_Vel = vec2(0.0f, 0.0f);
65 p.m_LifeSpan = 0.5f;
66 p.m_StartSize = 16.0f;
67 p.m_EndSize = 0.0f;
68 p.m_Rot = random_angle();
69 p.m_Rotspeed = pi * 2.0f;
70 p.m_Gravity = 500.0f;
71 p.m_Friction = 0.9f;
72 p.m_FlowAffected = 0.0f;
73 p.m_Color.a = Alpha;
74 p.m_StartAlpha = Alpha;
75 GameClient()->m_Particles.Add(CParticles::GROUP_GENERAL, &p);
76}
77
78void CEffects::FreezingFlakes(vec2 Pos, vec2 Size, float Alpha)
79{

Callers 2

RenderPlayerMethod · 0.80
RenderPickupMethod · 0.80

Calls 4

random_floatFunction · 0.85
random_angleFunction · 0.85
SetDefaultMethod · 0.80
AddMethod · 0.45

Tested by

no test coverage detected