better particles courtesy of eve on the nekoweb dc
All checks were successful
/ test (push) Successful in 15s

This commit is contained in:
Soph :3 2024-09-18 14:12:02 +03:00
parent 7beb050aca
commit 734412cc44
Signed by: sophie
GPG key ID: EDA5D222A0C270F2

View file

@ -43,7 +43,8 @@ class Particle {
"%," +
(85 + 10 * Math.random()) +
"%)";*/
this.style = Math.random() < 0.5 ? "-" : Math.random() > 0.5 ? "+" : "*";
const characters = ["+", "⊹", ".", "-"]
this.style = characters[Math.floor(Math.random() * characters.length)];
}
render() {
@ -54,7 +55,7 @@ class Particle {
renderSurfaceContext.save();
renderSurfaceContext.fillStyle = this.color;
renderSurfaceContext.font = Math.floor(this.id * 60) + "px Arial";
renderSurfaceContext.font = Math.floor(this.id * 80) + "px Arial";
renderSurfaceContext.translate(this.x, this.y);
renderSurfaceContext.rotate(2 * Math.PI * this.id);
renderSurfaceContext.fillText(this.style, -width2 / 2, 4);