fix README, SYNC, DATENSCHUTZ
Some checks failed
Dynamic Branch Deploy / build-and-deploy (push) Has been cancelled
Some checks failed
Dynamic Branch Deploy / build-and-deploy (push) Has been cancelled
This commit is contained in:
@@ -5,23 +5,20 @@ class Particle {
|
||||
constructor(x, y, type) {
|
||||
this.x = x;
|
||||
this.y = y;
|
||||
this.life = 1.0; // 1.0 = 100% Leben
|
||||
this.type = type; // 'dust', 'sparkle', 'explosion'
|
||||
this.life = 1.0;
|
||||
this.type = type;
|
||||
|
||||
// Zufällige Geschwindigkeit
|
||||
const angle = Math.random() * Math.PI * 2;
|
||||
let speed = Math.random() * 2;
|
||||
|
||||
if (type === 'dust') {
|
||||
// Staub fliegt eher nach oben/hinten
|
||||
this.vx = -2 + Math.random();
|
||||
this.vy = -1 - Math.random();
|
||||
this.decay = 0.05; // Verschwindet schnell
|
||||
this.decay = 0.05;
|
||||
this.color = '#ddd';
|
||||
this.size = Math.random() * 4 + 2;
|
||||
}
|
||||
else if (type === 'sparkle') {
|
||||
// Münzen glitzern in alle Richtungen
|
||||
speed = Math.random() * 4 + 2;
|
||||
this.vx = Math.cos(angle) * speed;
|
||||
this.vy = Math.sin(angle) * speed;
|
||||
@@ -30,7 +27,6 @@ class Particle {
|
||||
this.size = Math.random() * 3 + 1;
|
||||
}
|
||||
else if (type === 'explosion') {
|
||||
// Tod
|
||||
speed = Math.random() * 6 + 2;
|
||||
this.vx = Math.cos(angle) * speed;
|
||||
this.vy = Math.sin(angle) * speed;
|
||||
@@ -65,7 +61,6 @@ class Particle {
|
||||
}
|
||||
}
|
||||
|
||||
// --- API ---
|
||||
|
||||
function spawnParticles(x, y, type, count = 5) {
|
||||
for(let i=0; i<count; i++) {
|
||||
@@ -74,7 +69,6 @@ function spawnParticles(x, y, type, count = 5) {
|
||||
}
|
||||
|
||||
function updateParticles() {
|
||||
// Rückwärts loopen zum sicheren Löschen
|
||||
for (let i = particles.length - 1; i >= 0; i--) {
|
||||
particles[i].update();
|
||||
if (particles[i].life <= 0) {
|
||||
|
||||
Reference in New Issue
Block a user