MCPcopy
hub / github.com/KilledByAPixel/LittleJS / kill

Method kill

examples/platformer/gameObjects.js:358–377  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

356 }
357
358 kill()
359 {
360 if (this.destroyed)
361 return;
362 this.destroy();
363
364 // spark effects
365 const emitter = new LJS.ParticleEmitter(
366 this.pos, 0, 0, .1, 100, .5, // pos, angle, size, time, rate, cone
367 0, // tileInfo
368 rgb(1,1,0), rgb(1,0,0), // colorStartA, colorStartB
369 rgb(1,1,0), rgb(1,0,0), // colorEndA, colorEndB
370 .2, .2, 0, .1, .1, // time, sizeStart, sizeEnd, speed, angleSpeed
371 1, 1, .5, 3.14, .1, // damp, angleDamp, gravityScale, particleCone, fade,
372 .5, 1, 1 // randomness, collide, additive
373 );
374 emitter.trailScale = 1;
375 emitter.restitution = .3;
376 emitter.angle = this.velocity.angle() + LJS.PI;
377 }
378}

Callers 2

collideWithObjectMethod · 0.95
collideWithTileMethod · 0.95

Calls 3

rgbFunction · 0.85
destroyMethod · 0.45
angleMethod · 0.45

Tested by

no test coverage detected