// TLW-Modell: Topologischer Warp-Antrieb (Arcade-Highscore Version) float zeit = 0; float warpFaktor = 1.0; float schiffX, schiffY; float kugelblitzEnergie = 0; float ricciTensor = 0; // Raumzeit-Krümmungsdichte // Gameplay & Score int score = 0; int leben = 3; float[] astX = new float[4]; float[] astY = new float[4]; float[] astSpeed = new float[4]; boolean gameOver = false; // Interaktive Parameter & Einsteiger-Features float triebwerksSpannung = 0.35; float resonanzFrequenz = 0.88; boolean autoAim = true; String statusText = "Pfeiltasten/Maus vertikal steuern. Weiche den Singularitäten aus!"; // Story-Event System int aktuellesEvent = 0; boolean eventOffen = true; String eventTitel = ""; String eventText = ""; void setup() { size(850, 650); schiffX = 120; schiffY = 240; // Asteroiden (Raumgitter-Risse) initialisieren for (int i = 0; i < 4; i++) { astX[i] = width + random(50, 400 + i*150); astY[i] = random(50, 450); astSpeed[i] = random(4, 7); } triggerEvent(0, "🌌 DAS ARCHIMEDES-BÜHRING-PROTOKOLL", "Achtung, Kommandant! Du steuerst den ersten feldinduzierten Warp-Gleiter. Durch die Krümmung des Raumes (Ricci-Tensor) ziehst du instabile Gitter-Risse (rote Singularitäten) an. Halte das Schiff stabil, reguliere die Taktfrequenz und sammle Warp-Punkte! Auto-Aim hält deine Netzfrequenz stabil."); } void draw() { background(5, 6, 12); if (!eventOffen && !gameOver) { zeit += 0.03 * warpFaktor; score += int(warpFaktor); // Schiff fliegt sanft zur Maus-Y-Achse (Optimiert für Touch & Web) if (mouseY > 30 && mouseY < 480) { schiffY = lerp(schiffY, mouseY, 0.08); } } // 1. DYNAMISCHES WARP-GITTER MIT BLAUVERSCHIEBUNG & RICCI-KRÜMMUNG int schritt = 30; ricciTensor = 0; for (int x = -30; x <= width + 30; x += schritt) { for (int y = -30; y <= height - 100; y += schritt) { float dx = (schiffX + 150) - x; float dy = schiffY - y; float abstand = sqrt(dx*dx + dy*dy); if (abstand == 0) abstand = 0.1; // Berechnung des Ricci-Tensors (Krümmungsdichte akkumulieren) if (abstand < 150) ricciTensor += (150 - abstand) * 0.005 * (kugelblitzEnergie / 255.0); // Topologische Gitterstauchung float verzerrung = 0; if (kugelblitzEnergie > 0 && abstand < 250) { verzerrung = map(abstand, 0, 250, 55, 0) * (kugelblitzEnergie / 255.0); } float posX = x + (dx / abstand) * verzerrung; float posY = y + (dy / abstand) * verzerrung; // BLAUVERSCHIEBUNG: Je höher der Warp-Faktor und je näher am Fokus, desto violetter/UV das Licht float blauAnteil = map(abstand, 0, 500, 255, 30) * (warpFaktor / 3.5); float rotAnteil = map(abstand, 0, 500, 30, 150) / (warpFaktor / 1.5); stroke(rotAnteil, 120 + blauAnteil*0.3, blauAnteil, map(abstand, 0, 400, 50, 10)); strokeWeight(1); noFill(); beginShape(); for (int i = 0; i < 6; i++) { float angle = PI / 3 * i + zeit * 0.02; vertex(posX + cos(angle)*16, posY + sin(angle)*16); } endShape(CLOSE); } } // 2. OBJEKT-ENGINE: GEFÄHRLICHE SINGULARITÄTEN (Gitter-Risse) for (int i = 0; i < 4; i++) { if (!eventOffen && !gameOver) { astX[i] -= astSpeed[i] * (warpFaktor * 0.6); if (astX[i] < -50) { astX[i] = width + random(50, 300); astY[i] = random(50, 450); astSpeed[i] = random(4, 8); } } // Zeichne feindliche Singularität (Roter Raum-Riss) stroke(255, 0, 50, 200); strokeWeight(2); fill(20, 0, 10); ellipse(astX[i], astY[i], 24, 24); noStroke(); fill(255, 50, 100, 100 + sin(zeit*20)*100); ellipse(astX[i], astY[i], 12 + sin(zeit*15)*4, 12 + sin(zeit*15)*4); // Kollisionsprüfung mit dem Schiff-Chassis float colDist = dist(schiffX, schiffY, astX[i], astY[i]); if (colDist < 35 && !eventOffen && !gameOver) { leben--; astX[i] = width + random(200, 500); // Zurücksetzen statusText = "💥 TREFFER! Topologischer Hüllenschaden!"; if (leben <= 0) gameOver = true; } } // 3. KUGELBLITZ & WARP-DYNAMIK if (kugelblitzEnergie > 0 && !eventOffen && !gameOver) { float kX = schiffX + 150; float kY = schiffY; // Optische Zündung fill(255, 0, 150, kugelblitzEnergie); noStroke(); ellipse(kX, kY, 18 + sin(zeit*25)*6, 18 + sin(zeit*25)*6); noFill(); stroke(0, 255, 230, kugelblitzEnergie * 0.7); ellipse(kX, kY, 45 + cos(zeit*12)*12, 45 + cos(zeit*12)*12); warpFaktor = lerp(warpFaktor, 3.8, 0.015); } else { warpFaktor = lerp(warpFaktor, 1.0, 0.05); } // Schiff zeichnen if (!gameOver) { drawRaumschiff(schiffX, schiffY); } else { fill(255, 50, 50); textAlign(CENTER, CENTER); textSize(24); text("GAME OVER\nTopologischer Strukturkollaps!", width/2, height/2 - 40); textSize(14); fill(255); text("Klicke den ZÜNDEN-Button unten rechts für einen Reset", width/2, height/2 + 30); } // 4. INTERFACE OVERLAYS drawInterface(); if (eventOffen) drawModal(); } void drawRaumschiff(float cx, float cy) { // Triebwerks-Aura (Blauverschiebungseffekt) fill(0, 150, 255, 40 + int(warpFaktor*25)); noStroke(); ellipse(cx - 35, cy, 30 * warpFaktor, 15 * warpFaktor); fill(35, 45, 60); stroke(0, 255, 200, 180); strokeWeight(1.5); rect(cx - 30, cy - 22, 18, 44, 3); // Rumpf fill(245, 248, 255); stroke(15, 25, 40); beginShape(); vertex(cx - 20, cy - 18); vertex(cx + 55, cy - 8); vertex(cx + 85, cy); vertex(cx + 55, cy + 8); vertex(cx - 20, cy + 18); vertex(cx - 10, cy); endShape(CLOSE); } void triggerEvent(int id, String titel, String text) { aktuellesEvent = id; eventTitel = titel; eventText = text; eventOffen = true; } void drawModal() { fill(4, 5, 12, 235); noStroke(); rect(0, 0, width, height); fill(16, 20, 32); stroke(0, 255, 200, 160); strokeWeight(2); rect(140, 160, 570, 310, 6); fill(0, 255, 200); textSize(15); textAlign(LEFT, TOP); text(eventTitel, 175, 190); fill(235); textSize(13); text(eventText, 175, 230, 500, 180); fill(0, 150, 255); noStroke(); rect(320, 400, 220, 42, 4); fill(255); textAlign(CENTER, CENTER); text("SCHIFFS-SYSTEME REBOOTEN ▶", 430, 421); textAlign(LEFT, TOP); } void drawInterface() { fill(12, 14, 22); noStroke(); rect(0, 530, width, 120); stroke(35, 48, 68); line(0, 530, width, 530); // Stats & Highscore fill(255); textSize(13); textAlign(LEFT, TOP); text("TLW ARCADE: FIELD-WARP DRIVER", 25, 546); fill(0, 255, 200); text("SCORE: " + score, 265, 546); fill(255, 50, 100); text("SCHILD-MATRIX: " + (leben*33) + "%", 385, 546); fill(200, 220, 240); textSize(11); text("Ricci-Krümmung R_μν: " + nf(ricciTensor, 1, 3) + " m⁻² | Geschw: " + nf(warpFaktor, 1, 2) + " c", 25, 572); // Frequenz-Slider float sx = 400; float sy = 600; fill(140, 160, 180); text("NETZ-INTERFERENZ: " + nf(triebwerksSpannung * 100, 2, 0) + " PHz", sx, sy - 12); stroke(36, 48, 66); strokeWeight(5); line(sx, sy, sx + 220, sy); stroke(255, 0, 100, 60); strokeWeight(10); point(sx + map(resonanzFrequenz, 0.2, 1.1, 0, 220), sy); stroke(0, 255, 200); strokeWeight(13); point(sx + map(triebwerksSpannung, 0.2, 1.1, 0, 220), sy); strokeWeight(1); // Auto-Aim Schalter fill(autoAim ? color(0, 150, 100) : color(40, 45, 55)); rect(25, 592, 110, 24, 3); fill(255); textSize(10); textAlign(CENTER, CENTER); text(autoAim ? "🎯 AUTO-AIM: AN" : "❌ AUTO-AIM: AUS", 80, 604); // Trigger/Reset Button fill(kugelblitzEnergie > 0 && !gameOver ? color(255, 0, 100) : color(0, 120, 240)); rect(665, 546, 160, 54, 4); fill(255); text(gameOver ? "NEUSTART 🔄" : (kugelblitzEnergie > 0 ? "WARP STOPP 🛑" : "ZÜNDEN 💥"), 745, 573); textAlign(LEFT, TOP); } void mousePressed() { if (eventOffen) { if (mouseX > 320 && mouseX < 540 && mouseY > 400 && mouseY < 442) eventOffen = false; return; } if (mouseX > 25 && mouseX < 135 && mouseY > 592 && mouseY < 616) autoAim = !autoAim; // Zünden / Reset-Aktion if (mouseX > 665 && mouseX < 825 && mouseY > 546 && mouseY < 600) { if (gameOver) { // Reset des gesamten Spiels score = 0; leben = 3; gameOver = false; kugelblitzEnergie = 0; schiffX = 120; for (int i = 0; i < 4; i++) astX[i] = width + random(50, 400); statusText = "Systeme rebootet. Warp-Feld bereit."; } else { if (kugelblitzEnergie > 0) { kugelblitzEnergie = 0; statusText = "Feld kollabiert. Unterlichtgeschwindigkeit."; } else { if (autoAim) triebwerksSpannung = resonanzFrequenz; if (abs(triebwerksSpannung - resonanzFrequenz) < 0.08) { kugelblitzEnergie = 255; statusText = "Warp-Blase stabilisiert! Beschleunigung läuft."; } else { statusText = "Fehlschlag! Frequenz außerhalb der Ricci-Resonanz."; } } } } uSlider(); } void mouseDragged() { if (!eventOffen) uSlider(); } void uSlider() { if (mouseX > 400 && mouseX < 620 && mouseY > 585 && mouseY < 615 && kugelblitzEnergie == 0) { triebwerksSpannung = map(mouseX, 400, 620, 0.2, 1.1); } }