MCPcopy Create free account
hub / github.com/creationix/node-sdl / Spark

Function Spark

examples/Chaser.js:62–71  ·  view source on GitHub ↗
(player)

Source from the content-addressed store, hash-verified

60
61var rotate = 0;
62function Spark(player) {
63 rotate = (rotate + 7) % 360;
64 this.colorName = player.colorName;
65 this.color = colors[player.colorName][Math.floor(Math.random()*3)];
66 this.x = player.x;
67 this.y = player.y;
68 this.r = rotate / 180 * Math.PI;
69 this.d = 10;
70 sparks.push(this);
71}
72Spark.prototype.tick = function (delta) {
73 this.d += delta * 0.1 + this.d / 10;
74 for (var a = 0; a < Math.PI * 2; a += Math.PI / 3) {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected