/** * ============================================================================================== * Modul: DTIM-ZEC ZERO-CLICK FARM TO COSMOS (0-KLICK-SPIEL & TRAKTOR-GEFECHT) * Datei: DTIM_ZEC_ZeroClick_Farm_Space.pde * Framework: DTIM-ZEC MODULAR PHYSICS FRAMEWORK (DAMTP ACADEMIC STANDARD) * Copyright: (c) 2026 Jan Bühring & Adaptive Intelligence Synthesis Network (Google AI) * Lizenz: MIT License * Plattform: Processing 4.5.6 (Linux x64) & Processing.js (processing.min.js) * Steuerung: 0-Klick-Prinzip: Bewege einfach den Mauszeiger in eine der 8 Richtungszonen * rund um die Spielfigur! [H] Sehhilfe (Standard / Farbenblind / Max-Kontrast) * ============================================================================================== */ float worldX = 0.0; float worldY = 0.0; // Ressourcen aus deinem 0-Klick-Skript int geld = 25; int korn = 2; int tom = 2; int wasser = 2; int heu = 0; int milch = 0; int kaese = 0; int mehl = 0; int pizza = 0; int pork = 0; // Feld- & Gebäude-Fortschritte float kornGrow = 0.0; float tomGrow = 0.0; boolean stallBuilt = false; boolean muehleBuilt = false; boolean kaeseBuilt = false; float stallWork = 0.0; float muehleWork = 0.0; float kaeseWork = 0.0; float pizzaWork = 0.0; // Raum-Sektor (Chargo / Traktor / Waste / Force aus dem zweiten Teil deines Skripts) int forceAmmo = 50; int chargoMax = 60; int traktorLvl = 2; int wasteCount = 0; int spaceLevel = 1; float enemyX = 220.0; float enemyY = 540.0; float enemyHP = 100.0; boolean enemyHostile = true; int a11yTheme = 0; float walkAnim = 0.0; String statusBanner = "0-Klick-Steuerung: Halte die Maus links, rechts, oben oder unten vom Zentrum!"; void setup() { size(920, 700); noSmooth(); frameRate(60); } int getThemeCol(int theme, int role) { if (theme == 1) { if (role == 0) return color(6, 12, 20); if (role == 1) return color(14, 22, 36); if (role == 2) return color(180, 120, 10); return color(10, 75, 130); } if (theme == 2) { return color(0, 0, 0); } if (role == 0) return color(8, 12, 16); if (role == 1) return color(14, 18, 28); if (role == 2) return color(122, 16, 38); return color(18, 46, 98); } void draw() { background(getThemeCol(a11yTheme, 0)); // 1. 0-KLICK-BEWEGUNG: Mausposition relativ zum Zentrum steuert die Figur float cx = width * 0.5; float cy = 285.0; float dx = mouseX - cx; float dy = mouseY - cy; float distCenter = sqrt(dx * dx + dy * dy); boolean isMoving = false; if (mouseY < 560 && distCenter > 65.0) { float spd = constrain((distCenter - 65.0) / 70.0, 0.4, 3.2); worldX = constrain(worldX - (dx / distCenter) * spd, -420.0, 420.0); worldY = constrain(worldY - (dy / distCenter) * spd, -520.0, 260.0); walkAnim += 0.24 * spd; isMoving = true; } // 2. Prozedurale Landschaft & Gebäude (ohne externe Bilddatei) drawFarmAndSpaceWorld(cx, cy); // 3. Animierte 0-Klick-Spielfigur im Zentrum (Kopf, Arme, Beine) drawStickHero(cx, cy, isMoving); // 4. Interaktions-Logik prüfen (automatisch beim Drüberlaufen ohne Klicken!) processZeroClickZones(cx, cy); // 5. Inventar- & Telemetrie-HUD unten drawBottomInventoryHUD(); } void drawFarmAndSpaceWorld(float cx, float cy) { // Dezentes 0-Klick-Steuerungs-Fadenkreuz um die Spielfigur noFill(); stroke(59, 110, 194, 70); ellipse(cx, cy, 130, 130); // --- GEBÄUDE & FELDER RELATIV ZU (cx + worldX, cy + worldY) --- // 1. Korn-Feld drawBuildingBox(cx - 260 + worldX, cy - 170 + worldY, 210, 85, kornGrow > 0 ? color(175, 155, 35) : color(110, 75, 35), "Korn-Feld (" + int(kornGrow) + "%)", "Drüberlaufen sät & erntet"); // 2. Tomaten-Feld drawBuildingBox(cx - 260 + worldX, cy - 65 + worldY, 210, 85, tomGrow > 0 ? color(185, 45, 55) : color(110, 75, 35), "Tomaten-Feld (" + int(tomGrow) + "%)", "Liefert Tomaten & Stroh"); // 3. Brunnen (Wasser) drawBuildingBox(cx - 30 + worldX, cy - 170 + worldY, 150, 85, color(18, 75, 155), "Wasser-Brunnen", "Füllt Wasser auf (" + wasser + ")"); // 4. Shop (Verkauf) drawBuildingBox(cx - 260 + worldX, cy + 75 + worldY, 210, 85, color(122, 16, 38), "Markt-Shop", "Verkauft Ernte & Pizza"); // 5. Kuh-Stall (15 EUR -> produziert Milch) drawBuildingBox(cx + 150 + worldX, cy - 170 + worldY, 220, 85, stallBuilt ? color(30, 115, 70) : color(35, 45, 65), stallBuilt ? "Kuh-Stall (" + int(stallWork) + "%)" : "Kuh-Stall kaufen (15 EUR)", "2 Korn + 4 Stroh -> 4 Milch"); // 6. Käserei (30 EUR -> produziert Käse) drawBuildingBox(cx + 150 + worldX, cy - 55 + worldY, 220, 85, kaeseBuilt ? color(175, 135, 25) : color(35, 45, 65), kaeseBuilt ? "Käserei (" + int(kaeseWork) + "%)" : "Käserei kaufen (30 EUR)", "4 Milch -> 2 Käse"); // 7. Mühle (25 EUR -> produziert Mehl) drawBuildingBox(cx + 150 + worldX, cy + 65 + worldY, 220, 85, muehleBuilt ? color(135, 95, 45) : color(35, 45, 65), muehleBuilt ? "Mühle (" + int(muehleWork) + "%)" : "Mühle kaufen (25 EUR)", "4 Korn -> 3 Mehl"); // 8. Pizza-Manufaktur drawBuildingBox(cx - 20 + worldX, cy + 75 + worldY, 150, 85, color(165, 35, 55), "Pizza-Ofen (" + int(pizzaWork) + "%)", "Mehl + Käse + Tomate"); // 9. Raum-Sektor im Süden (Chargo / Traktor / Laser-Gefecht aus dem 2. Teil deines Skripts) float spaceTop = cy + 205 + worldY; fill(6, 8, 16); stroke(225, 55, 85); rect(cx - 280 + worldX, spaceTop, 650, 230, 8); fill(255); textSize(13); textAlign(LEFT, TOP); text("DTIM-ZEC RAUM-SEKTOR (0-Klick Laser & Traktorstrahl) · Level " + spaceLevel, cx - 264 + worldX, spaceTop + 10); // Gegnerisches / Freundliches Schiff im Raum-Sektor enemyX = cx + sin(frameCount * 0.03) * 180.0 + worldX; enemyY = spaceTop + 125.0; fill(enemyHostile ? color(220, 42, 74) : color(58, 135, 255)); stroke(255); rect(enemyX - 24, enemyY - 16, 48, 32, 5); fill(255); textSize(10); textAlign(CENTER, CENTER); text(enemyHostile ? "HP:" + int(enemyHP) : "CHARGO", enemyX, enemyY); } void drawBuildingBox(float bx, float by, float bw, float bh, int bgCol, String title, String sub) { fill(a11yTheme == 2 ? color(0) : bgCol); stroke(a11yTheme == 2 ? color(255, 255, 0) : color(180, 200, 235)); rect(bx, by, bw, bh, 6); fill(255); textSize(13); textAlign(CENTER, CENTER); text(title, bx + bw * 0.5, by + bh * 0.36); fill(230, 238, 250); textSize(10); text(sub, bx + bw * 0.5, by + bh * 0.70); } void drawStickHero(float cx, float cy, boolean moving) { float swingA = moving ? sin(walkAnim) * 14.0 : 0.0; float swingB = moving ? cos(walkAnim) * 14.0 : 0.0; stroke(255); strokeWeight(2.5); fill(245, 248, 255); ellipse(cx, cy - 26, 26, 26); // Kopf line(cx, cy - 13, cx, cy + 20); // Körper line(cx, cy - 6, cx - 16, cy + 10 + swingA); // Linker Arm line(cx, cy - 6, cx + 16, cy + 10 + swingB); // Rechter Arm line(cx, cy + 20, cx - 12, cy + 46 + swingB); // Linkes Bein line(cx, cy + 20, cx + 12, cy + 46 + swingA); // Rechtes Bein strokeWeight(1.0); } boolean isHeroOver(float cx, float cy, float bx, float by, float bw, float bh) { return (cx >= bx && cx <= bx + bw && cy >= by && cy <= by + bh); } void processZeroClickZones(float cx, float cy) { // 1. Brunnen if (isHeroOver(cx, cy, cx - 30 + worldX, cy - 170 + worldY, 150, 85)) { if (frameCount % 25 == 0 && wasser < 10) { wasser++; statusBanner = "Brunnen: Frisches Wasser geschöpft (Wasser: " + wasser + ")."; } } // 2. Korn-Feld if (isHeroOver(cx, cy, cx - 260 + worldX, cy - 170 + worldY, 210, 85)) { if (kornGrow == 0 && korn >= 1) { korn--; kornGrow = 1.0; statusBanner = "Korn ausgesät! Laufe zum Brunnen oder bleibe zum Bewässern stehen."; } else if (kornGrow > 0 && wasser >= 1) { kornGrow += 1.4; if (kornGrow >= 100.0) { kornGrow = 0.0; wasser--; korn += 4; heu += 4; statusBanner = "Korn-Ernte eingefahren: +4 Korn & +4 Stroh!"; } } } // 3. Tomaten-Feld if (isHeroOver(cx, cy, cx - 260 + worldX, cy - 65 + worldY, 210, 85)) { if (tomGrow == 0 && tom >= 1) { tom--; tomGrow = 1.0; statusBanner = "Tomaten gepflanzt!"; } else if (tomGrow > 0 && wasser >= 1) { tomGrow += 1.4; if (tomGrow >= 100.0) { tomGrow = 0.0; wasser--; tom += 4; heu += 2; statusBanner = "Tomaten-Ernte: +4 Tomaten & +2 Stroh!"; } } } // 4. Kuh-Stall if (isHeroOver(cx, cy, cx + 150 + worldX, cy - 170 + worldY, 220, 85)) { if (!stallBuilt && geld >= 15) { geld -= 15; stallBuilt = true; statusBanner = "Kuh-Stall gebaut (-15 EUR)!"; } else if (stallBuilt && korn >= 2 && heu >= 4) { stallWork += 1.6; if (stallWork >= 100.0) { stallWork = 0.0; korn -= 2; heu -= 4; milch += 4; statusBanner = "Kuh-Stall: +4 frische Milch produziert!"; } } } // 5. Käserei if (isHeroOver(cx, cy, cx + 150 + worldX, cy - 55 + worldY, 220, 85)) { if (!kaeseBuilt && geld >= 30) { geld -= 30; kaeseBuilt = true; statusBanner = "Käserei errichtet (-30 EUR)!"; } else if (kaeseBuilt && milch >= 4) { kaeseWork += 1.6; if (kaeseWork >= 100.0) { kaeseWork = 0.0; milch -= 4; kaese += 2; statusBanner = "Käserei: +2 Laibe Käse gereift!"; } } } // 6. Mühle if (isHeroOver(cx, cy, cx + 150 + worldX, cy + 65 + worldY, 220, 85)) { if (!muehleBuilt && geld >= 25) { geld -= 25; muehleBuilt = true; statusBanner = "Mühle errichtet (-25 EUR)!"; } else if (muehleBuilt && korn >= 4) { muehleWork += 1.6; if (muehleWork >= 100.0) { muehleWork = 0.0; korn -= 4; mehl += 3; statusBanner = "Mühle: +3 Sack Mehl gemahlen!"; } } } // 7. Pizza-Manufaktur if (isHeroOver(cx, cy, cx - 20 + worldX, cy + 75 + worldY, 150, 85)) { if (mehl >= 1 && kaese >= 1 && tom >= 1) { pizzaWork += 2.0; if (pizzaWork >= 100.0) { pizzaWork = 0.0; mehl--; kaese--; tom--; pizza++; statusBanner = "Pizza-Manufaktur: 1 knusprige Steinofen-Pizza gebacken!"; } } } // 8. Markt-Shop (Verkauf) if (isHeroOver(cx, cy, cx - 260 + worldX, cy + 75 + worldY, 210, 85)) { int earned = 0; if (pizza > 0) { earned += pizza * 28; pizza = 0; } if (kaese > 0) { earned += kaese * 12; kaese = 0; } if (mehl > 0) { earned += mehl * 5; mehl = 0; } if (milch > 0) { earned += milch * 4; milch = 0; } if (korn > 3) { int sellK = korn - 2; earned += sellK * 2; korn = 2; } if (tom > 3) { int sellT = tom - 2; earned += sellT * 2; tom = 2; } if (earned > 0) { geld += earned; statusBanner = "Markt-Shop: Waren für +" + earned + " EUR verkauft! (Geld: " + geld + " EUR)"; } } // 9. Raum-Sektor (0-Klick Laser & Traktorstrahl, wenn Mauszeiger über das Schiff fährt) if (dist(mouseX, mouseY, enemyX, enemyY) < 42.0) { if (enemyHostile && forceAmmo > 0) { stroke(65, 145, 255); strokeWeight(3.0); line(cx, cy - 10, enemyX, enemyY); strokeWeight(1.0); enemyHP -= 1.8; if (frameCount % 15 == 0) forceAmmo = max(0, forceAmmo - 1); if (enemyHP <= 0) { enemyHostile = false; enemyHP = 100.0; geld += 45; wasteCount++; statusBanner = "Feindschiff kampfunfähig! Traktorstrahl bereit (+45 EUR)."; } } else if (!enemyHostile) { // Traktorstrahl lädt Chargo & Force wieder auf! stroke(0, 255, 180); strokeWeight(3.0); line(cx, cy - 10, enemyX, enemyY); strokeWeight(1.0); forceAmmo = min(chargoMax, forceAmmo + 1); if (forceAmmo >= chargoMax) { enemyHostile = true; spaceLevel++; chargoMax += 10; statusBanner = "Chargo voll geladen! Raum-Level " + spaceLevel + " gestartet."; } } } } void drawBottomInventoryHUD() { int hy = 560; fill(getThemeCol(a11yTheme, 1)); noStroke(); rect(0, hy, width, height - hy); stroke(225, 55, 85); line(0, hy, width, hy); fill(255); textSize(14); textAlign(LEFT, TOP); text("Geld: " + geld + " EUR | Pizza: " + pizza + " | Force/Chargo: " + forceAmmo + "/" + chargoMax + " | Raum-Level: " + spaceLevel, 16, hy + 12); fill(215, 228, 248); textSize(12); text("Korn: " + korn + " · Tomaten: " + tom + " · Wasser: " + wasser + " · Stroh: " + heu + " · Milch: " + milch + " · Käse: " + kaese + " · Mehl: " + mehl + " · Waste: " + wasteCount, 16, hy + 42); fill(255, 220, 80); textSize(12); text(statusBanner, 16, hy + 74); fill(175, 190, 215); textSize(11); text("0-Klick-Prinzip: Kein Klicken nötig — bewege einfach die Maus! [H] Sehhilfe umschalten", 16, hy + 104); } void keyPressed() { if (key == 'h' || key == 'H') a11yTheme = (a11yTheme + 1) % 3; }