Fix: Initialisierung korrigiert

This commit is contained in:
2026-04-18 18:47:35 +02:00
parent 27a28ce76e
commit 288d5f5734

View File

@@ -142,19 +142,12 @@
// Initialisierung
function initGame() {
rivers.length = 0;
for (let i = 0; i < numRivers; i++) {
rivers.push({
y: canvas.height - 150 - (i * 60),
width: 40 + Math.random() * 30,
speed: 1 + Math.random() * 1.5,
direction: i % 2 === 0 ? 1 : -1,
items: []
});
// Logs (Baumstämme im Wasser)
logs.length = 0;
for (let i = 0; i < numLogs; i++) {
logs.push({
y: canvas.height - 150 - (i * 60),
x: Math.random() * (canvas.width - 100),
width: 80 + Math.random() * 60,
speed: 1 + Math.random() * 1.5,
direction: i % 2 === 0 ? 1 : -1
@@ -172,11 +165,12 @@
});
}
// Aligatoren (Gegner)
alligators.length = 0;
for (let i = 0; i < numAlligators; i++) {
alligators.push({
x: Math.random() * canvas.width,
y: 200 + Math.random() * 200,
y: 150 + Math.random() * 250,
width: 60,
height: 30,
speed: 1.5 + Math.random(),