// TLW-Modell: SpaceX Vakuum-Ernter (Gravitationslinsen- & Color-Update) float zeit = 0; float starshipX, starshipY; // Quanten & Schockwellen-Variablen float[] qX = new float[4]; float[] qY = new float[4]; float[] qBrechung = new float[4]; int ladung = 0; int score = 0; boolean gameOver = false; float schockWelleRadius = 0; float schockWelleX, schockWelleY; float schockWelleIntensitaet = 0; // UI & Regler float ladeFrequenz = 0.45; boolean autoAim = true; float resonanzPunkt = 0.78; String statusText = "Fange die Vakuum-Quanten ein! Die Fluggeschwindigkeit steigt radikal per Wurzelfunktion."; boolean eventOffen = true; String eventTitel = ""; String eventText = ""; void setup() { size(850, 650); starshipX = 140; starshipY = 240; for (int i = 0; i < 4; i++) { qX[i] = width + random(50, 400 + i*150); qY[i] = random(60, 440); qBrechung[i] = random(1.1, 1.8); } triggerEvent(0, "🌌 QUANTUM HARVESTER: DAS WURZEL-DILEMMA", "Willkommen beim SpaceX-Vakuum-Ernter. Du sammelst virtuelle Energiepakete direkt aus den Nullpunkt-Fluktuationen des Raumes. Physikalische HĂŒrde: Die Dynamik folgt einer Wurzelfunktion! Je mehr Energie du lĂ€dst, desto instabiler wird das Gitter und desto schneller rasen die Quanten auf dich zu."); } void draw() { background(6, 8, 14); if (!eventOffen && !gameOver) { zeit += 0.02; if (mouseY > 40 && mouseY < 470) { starshipY = lerp(starshipY, mouseY, 0.1); } if (schockWelleIntensitaet > 0) { schockWelleRadius += 10; schockWelleIntensitaet -= 4; } } float schiffSkalierung = 1.0 + (ladung / 100.0) * 0.3; // 1. HEXAGONALES NETZ MIT VERZERRUNG UND SCHOCKWELLE int schritt = 30; for (int x = -30; x <= width + 30; x += schritt) { for (int y = -30; y <= height - 100; y += schritt) { float dx = starshipX - x; float dy = starshipY - y; float abstand = sqrt(dx*dx + dy*dy); if (abstand == 0) abstand = 0.1; float kompression = (abstand < 180) ? map(abstand, 0, 180, 25 * (ladung/100.0), 0) : 0; float sDx = x - schockWelleX; float sDy = y - schockWelleY; float sAbstand = sqrt(sDx*sDx + sDy*sDy); float schockVersatz = 0; if (schockWelleIntensitaet > 0 && abs(sAbstand - schockWelleRadius) < 40) { schockVersatz = map(abs(sAbstand - schockWelleRadius), 0, 40, 20 * (schockWelleIntensitaet / 255.0), 0); } float posX = x + (dx / abstand) * kompression + (sDx / (sAbstand == 0 ? 1 : sAbstand)) * schockVersatz; float posY = y + (dy / abstand) * kompression + (sDy / (sAbstand == 0 ? 1 : sAbstand)) * schockVersatz; float schockGluehen = (schockWelleIntensitaet > 0 && abs(sAbstand - schockWelleRadius) < 50) ? map(abs(sAbstand - schockWelleRadius), 0, 50, schockWelleIntensitaet, 0) : 0; stroke(schockGluehen * 0.5, 130 + schockGluehen * 0.5, 255, map(abstand, 0, 400, 40, 12)); strokeWeight(schockGluehen > 10 ? 1.5 : 1); noFill(); beginShape(); for (int i = 0; i < 6; i++) { float angle = PI / 3 * i + zeit * 0.01; vertex(posX + cos(angle)*16, posY + sin(angle)*16); } endShape(CLOSE); } } // 2. WURZELFUNKTION-ENGINE MIT GRAVITATIONSLINSEN-EFFEKT float wurzelSchwierigkeit = 4.0 + sqrt(ladung) * 1.3; for (int i = 0; i < 4; i++) { if (!eventOffen && !gameOver) { qX[i] -= wurzelSchwierigkeit * qBrechung[i]; qY[i] += sin(zeit * 4 + i) * 1.5; // GRAVITATIONSLINSE: Schockwelle krĂŒmmt die Flugbahn der Quanten ablenkend weg if (schockWelleIntensitaet > 0) { float sDx = qX[i] - schockWelleX; float sDy = qY[i] - schockWelleY; float sAbstand = sqrt(sDx*sDx + sDy*sDy); if (abs(sAbstand - schockWelleRadius) < 60) { float ablenkungsKraft = map(abs(sAbstand - schockWelleRadius), 0, 60, 4.5, 0) * (schockWelleIntensitaet / 255.0); qY[i] += (sDy / (sAbstand == 0 ? 1 : sAbstand)) * ablenkungsKraft; } } if (qX[i] < -40) { qX[i] = width + random(50, 300); qY[i] = random(60, 440); ladung = constrain(ladung - 10, 0, 100); statusText = "Ein Quant ist entwischt! Gitter-Spannungsabfall (-10%)."; } } stroke(0, 255, 200, 180); strokeWeight(1.5); fill(10, 35, 45); ellipse(qX[i], qY[i], 20, 20); fill(255, 255, 255, 150 + sin(zeit * 15) * 100); noStroke(); ellipse(qX[i], qY[i], 8, 8); float d = dist(starshipX - 10, starshipY, qX[i], qY[i]); if (d < 35 * schiffSkalierung && !eventOffen && !gameOver) { schockWelleX = qX[i]; schockWelleY = qY[i]; schockWelleRadius = 0; schockWelleIntensitaet = 255; qX[i] = width + random(100, 400); qY[i] = random(60, 440); score += 25 * int(wurzelSchwierigkeit * 0.2); ladung = constrain(ladung + 15, 0, 100); statusText = "⚡ QUANT COLLAPSED! Vakuum-Energie erfolgreich akkumuliert."; if (ladung >= 100) { gameOver = true; statusText = "MISSION ERFOLGREICH! Akkumulator zu 100% geladen."; } } } pushMatrix(); translate(starshipX, starshipY); scale(schiffSkalierung); translate(-starshipX, -starshipY); drawStarship(starshipX, starshipY); popMatrix(); drawInterface(wurzelSchwierigkeit); if (eventOffen) drawModal(); } void drawStarship(float cx, float cy) { stroke(0, 255, 180, 100 + ladung * 1.5); strokeWeight(2.5); fill(15, 25, 40); ellipse(cx - 24, cy, 14, 42); fill(215, 220, 230); stroke(35, 45, 60); strokeWeight(1.5); beginShape(); vertex(cx - 20, cy - 14); vertex(cx + 65, cy - 14); vertex(cx + 105, cy - 5); vertex(cx + 120, cy); vertex(cx + 105, cy + 5); vertex(cx + 65, cy + 14); vertex(cx - 20, cy + 14); vertex(cx - 15, cy - 14); endShape(CLOSE); fill(55, 60, 70); rect(cx - 18, cy - 20, 10, 6); rect(cx - 18, cy + 14, 10, 6); if (ladung > 0) { fill(0, 255, 180, 80 + int(schockWelleIntensitaet * 0.5)); noStroke(); ellipse(cx - 10, cy, 16, 16); } } void triggerEvent(int id, String titel, String text) { eventTitel = titel; eventText = text; eventOffen = true; } void drawModal() { fill(4, 5, 12, 230); noStroke(); rect(0, 0, width, height); fill(16, 20, 32); stroke(0, 255, 180, 160); strokeWeight(2); rect(140, 170, 570, 290, 5); fill(0, 255, 180); textSize(15); textAlign(LEFT, TOP); text(eventTitel, 175, 200); fill(235); textSize(13); text(eventText, 175, 240, 500, 160); fill(0, 150, 255); noStroke(); rect(325, 395, 200, 40, 4); fill(255); textAlign(CENTER, CENTER); text("ERNTE STARTEN ▶", 425, 415); textAlign(LEFT, TOP); } void drawInterface(float aktuelleGeschwindigkeit) { fill(12, 14, 22); noStroke(); rect(0, 530, width, 120); stroke(35, 48, 68); line(0, 530, width, 530); fill(255); textSize(13); textAlign(LEFT, TOP); text("SPACEX VACUUM HARVESTER ENGINE", 25, 546); fill(0, 255, 180); text("SCORE: " + score, 280, 546); // DYNAMISCHE FARB-GRADATION DES LADEBALKENS: GrĂŒn (0%) -> Orange (50%) -> GlĂŒhendes Rot (100%) float rBalken = map(ladung, 0, 100, 0, 255); float gBalken = map(ladung, 0, 100, 255, 60); fill(40, 50, 65); rect(420, 544, 150, 16, 3); fill(rBalken, gBalken, 100); rect(420, 544, map(ladung, 0, 100, 0, 150), 16, 3); fill(255); textSize(11); text("LADUNG: " + ladung + "%", 585, 546); fill(200, 220, 240); textSize(12); text("Status: " + statusText, 25, 572); fill(130, 150, 170); textFont(createFont("Courier", 11)); text("TLW-Skalierung: v_quant = 4.0 + sqrt(" + ladung + ") * 1.3 = " + nf(aktuelleGeschwindigkeit, 1, 2) + " L_t", 25, 602); textFont(createFont("Arial", 12)); if (gameOver) { fill(0, 200, 120); rect(665, 546, 160, 54, 4); fill(255); textAlign(CENTER, CENTER); textSize(13); text("NEUSTART 🔄", 745, 573); textAlign(LEFT, TOP); } else { float sx = 460; float sy = 602; fill(140, 160, 180); textSize(10); text("ABSORPTIONS-TAKT", sx - 120, sy - 4); stroke(36, 48, 66); strokeWeight(4); line(sx, sy, sx + 160, sy); if (autoAim) ladeFrequenz = resonanzPunkt; stroke(0, 255, 180); strokeWeight(10); point(sx + map(ladeFrequenz, 0.2, 1.1, 0, 160), sy); strokeWeight(1); fill(autoAim ? color(0, 150, 100) : color(40, 45, 55)); rect(665, 546, 160, 54, 4); fill(255); textAlign(CENTER, CENTER); text(autoAim ? "🎯 AUTO-AIM\nAKTIV" : "❌ AUTO-AIM\nINAKTIV", 745, 573); textAlign(LEFT, TOP); } } void mousePressed() { if (eventOffen) { if (mouseX > 325 && mouseX < 525 && mouseY > 395 && mouseY < 435) eventOffen = false; return; } if (mouseX > 665 && mouseX < 825 && mouseY > 546 && mouseY < 600) { if (gameOver) { ladung = 0; score = 0; gameOver = false; for (int i = 0; i < 4; i++) qX[i] = width + random(50, 400); statusText = "Akkumulator geleert. Starte Ernte neu!"; } else { autoAim = !autoAim; } } uSlider(); } void mouseDragged() { if (!eventOffen) uSlider(); } void uSlider() { if (mouseX > 460 && mouseX < 620 && mouseY > 590 && mouseY < 615 && !autoAim) { ladeFrequenz = map(mouseX, 460, 620, 0.2, 1.1); } }