Update velocity.js
This commit is contained in:
parent
abbc486d29
commit
61caddc895
|
|
@ -226,9 +226,11 @@ explodeAt = function(x,y,radius,fire="fire") {
|
||||||
pixel.temp += damage*radius*power;
|
pixel.temp += damage*radius*power;
|
||||||
pixelTempCheck(pixel);
|
pixelTempCheck(pixel);
|
||||||
// set the pixel.vx and pixel.vy depending on the angle and power
|
// set the pixel.vx and pixel.vy depending on the angle and power
|
||||||
var angle = Math.atan2(pixel.y-y,pixel.x-x);
|
if (!elements[pixel.element].excludeRandom) {
|
||||||
pixel.vx = Math.floor((pixel.vx|0) + Math.cos(angle) * (radius * power/10));
|
var angle = Math.atan2(pixel.y-y,pixel.x-x);
|
||||||
pixel.vy = Math.floor((pixel.vy|0) + Math.sin(angle) * (radius * power/10));
|
pixel.vx = Math.floor((pixel.vx|0) + Math.cos(angle) * (radius * power/10));
|
||||||
|
pixel.vy = Math.floor((pixel.vy|0) + Math.sin(angle) * (radius * power/10));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Loading…
Reference in New Issue