diff --git a/src/app/core/components/background/background.ts b/src/app/core/components/background/background.ts index 66a566b..a3d0263 100644 --- a/src/app/core/components/background/background.ts +++ b/src/app/core/components/background/background.ts @@ -81,6 +81,12 @@ export class Background { star.y += star.vy; } + // Bildschirm-Ränder + if (star.x < 0) star.x = this.width; + if (star.x > this.width) star.x = 0; + if (star.y < 0) star.y = document.body.scrollHeight; + if (star.y > document.body.scrollHeight) star.y = 0; + // Stern zeichnen mit Scroll-Parallax ctx.beginPath(); ctx.arc(star.x, star.y - this.scrollY * this.parallaxFactor, star.radius, 0, Math.PI * 2);