MCPcopy
hub / github.com/phoboslab/q1k3 / _spawn_particles

Method _spawn_particles

source/entity.js:193–205  ·  view source on GitHub ↗
(amount, speed = 1, model, texture, lifetime)

Source from the content-addressed store, hash-verified

191 }
192
193 _spawn_particles(amount, speed = 1, model, texture, lifetime) {
194 for (let i = 0; i < amount; i++) {
195 let particle = game_spawn(entity_particle_t, this.p);
196 particle._model = model;
197 particle._texture = texture;
198 particle._die_at = game_time + lifetime + Math.random() * lifetime * 0.2;
199 particle.v = vec3(
200 (Math.random() - 0.5) * speed,
201 Math.random() * speed,
202 (Math.random() - 0.5) * speed
203 );
204 }
205 }
206
207 _receive_damage(from, amount) {
208 if (this._dead) {

Callers 7

_did_collideMethod · 0.80
_did_collideMethod · 0.80
_killMethod · 0.80
_did_collideMethod · 0.80
_receive_damageMethod · 0.80
_killMethod · 0.80
_killMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected