/** * ============================================================================================== * Modul: DTIM-ZEC NORN ATOM-STARSHIP, MULTI-SHELL ATOMS & 3D VOXEL CITADEL (DE / EN) * Datei: TLW_Atom_Starship_Norn.pde * Framework: DTIM-ZEC MODULAR PHYSICS FRAMEWORK (DAMTP ACADEMIC STANDARD) * Architektur: Bilingual Start Gate (DE/EN) + Multi-Shell Atoms & Covalent Bonds (Resource Nodes) * + 0-Click Space Bases + Norn Tech-Tree + Isometric 3D Base + Software 3D Raycaster * 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 / Controls: * [Maus bewegen / Move Mouse] Kurs & Auto-Aim | [Klick / Space] Waffe [1-5] abfeuern * [1] Photon | [2] Gluon | [3] W-Boson | [4] Elektron | [5] Mesonenkanone * [T] Norn Tech-Tree | [B] 3D-Basis Isometrie | [V] 3D-Begehung | [0] 0-Klick-Modus * [L] Sprache Deutsch/English | [H] Sehhilfe (Standard / Farbenblind / Max-Kontrast) * ============================================================================================== */ // ============================================================================================== // MODUL 1: SPRACH- & SYSTEMKONSTANTEN (100% PROCESSING.JS-SICHER) // ============================================================================================== int langMode = 0; // 0 = Deutsch, 1 = English boolean languageChosen = false; // Zeigt beim Start den Sprachwahl-Dialog (Deutsch / English) int viewMode = 0; // 0 = Mikrokosmos, 1 = Tech-Tree [T], 2 = 3D-Basis [B], 3 = 3D-Walk [V] int a11yTheme = 0; // 0 = DTIM Standard, 1 = Farbenblind (Blau/Gold), 2 = Max-Kontrast float simTime = 0.0; // Welt & Norn-Raumschiff float WORLD_SIZE = 3200.0; float HALF_WORLD = 1600.0; float shipX = 0.0; float shipY = 0.0; float shipVX = 0.0; float shipVY = 0.0; float shipAngle = 0.0; float camX = 0.0; float camY = 0.0; // Rohstoffe, Handel & Forschung int rawErz = 45; int refinedErz = 60; int totalErzBuilt = 60; // Alle 100 Erz -> +1 Erz-Würfel in der 3D-Basis int rawQuanta = 3; int researchFP = 65; int totalFPBuilt = 65; // Alle 100 FP -> +1 Forschungs-Würfel in der 3D-Basis int creditsEUR = 40; int wasteEntropy = 0; int hullHP = 100; int maxHullHP = 100; int chargoMax = 80; // Kampf & Auto-Aim int activeWeapon = 5; // 1=Photon, 2=Gluon, 3=W-Boson, 4=Elektron, 5=Mesonenkanone boolean autoAim = true; boolean zeroClick = false; int autoFireTimer = 0; float aimAngle = 0.0; float currentEv = 10.20; MultiShellAtom lockedAtom = null; String sensorInfo = ""; boolean keyW = false, keyA = false, keyS = false, keyD = false; boolean keyTurnL = false, keyTurnR = false; boolean mouseSteer = true; // Zwei 0-Klick-Raumbasen im Mikrokosmos float baseAlphaX = 540.0; // Basis Alpha (NO): Erz-Raffinerie, Markt & Werft float baseAlphaY = -440.0; float baseBetaX = -540.0; // Basis Beta (SW): Norn-Forschungsstation & Plasma-Labor float baseBetaY = 440.0; // Entitäten-Listen (untypisiert für 100% Processing.js-Kompatibilität) ArrayList spaceAtoms; ArrayList spaceBonds; ArrayList spaceQuanta; ArrayList spaceRifts; ArrayList spaceShots; ArrayList shockRings; String bannerHead = ""; String bannerSub = ""; int bannerFlash = 0; // ============================================================================================== // MODUL 2: NORN TECH-TREE VARIABLEN (12 KNOTEN IN 4 ZWEIGEN) // ============================================================================================== int NUM_TECH = 12; String[] tCode = new String[12]; String[] tTitleDe = new String[12]; String[] tTitleEn = new String[12]; String[] tBranchDe = new String[12]; String[] tBranchEn = new String[12]; String[] tDescDe = new String[12]; String[] tDescEn = new String[12]; int[] tBranchId = new int[12]; int[] tTier = new int[12]; int[] tPrereq = new int[12]; int[] tCost = new int[12]; int[] tLevel = new int[12]; boolean freeTechMode = false; float nornAtpPulse = 40.0; // ============================================================================================== // MODUL 3: 3D VOXEL-BASIS & SOFTWARE 3D-RAYCASTER (OHNE P3D!) // ============================================================================================== int BASE_DIM = 14; int BASE_HEIGHT = 6; int[] baseVoxels = new int[14 * 14 * 6]; // 0=Frei, 1=Erz-Würfel, 2=Forschungs-Würfel int erzCubesCount = 0; int fpCubesCount = 0; int isoRotation = 0; float walkX = 7.5; float walkY = 7.5; float walkDirX = 1.0; float walkDirY = 0.0; float walkPlaneX = 0.0; float walkPlaneY = 0.66; // ============================================================================================== // ZWEISPRACHIGE TEXT-HELFER & FARB-PALETTEN // ============================================================================================== String tr(String de, String en) { return (langMode == 0) ? de : en; } int getUiPalette(int theme, int role) { if (theme == 1) { if (role == 0) return color(5, 9, 17); if (role == 1) return color(11, 17, 29); if (role == 2) return color(180, 120, 10); if (role == 3) return color(10, 75, 130); if (role == 4) return color(251, 191, 36); return color(255, 255, 255); } if (theme == 2) { if (role == 0) return color(0, 0, 0); if (role == 1) return color(0, 0, 0); if (role == 2) return color(0, 0, 0); if (role == 3) return color(0, 0, 0); if (role == 4) return color(255, 255, 0); return color(255, 255, 255); } if (role == 0) return color(6, 8, 14); if (role == 1) return color(13, 16, 26); if (role == 2) return color(122, 16, 38); if (role == 3) return color(18, 46, 98); if (role == 4) return color(225, 55, 85); return color(242, 246, 255); } int getKindColor(int theme, int k) { // 1=Proton, 2=Neutron, 3=Elektron, 4=Photon, 5=Gluon, 6=W-Boson, 7=Quantum, 8=Rift, 9=Meson if (theme == 1) { if (k == 1 || k == 9) return color(251, 191, 36); if (k == 2) return color(195, 210, 230); if (k == 7) return color(52, 211, 153); if (k == 8) return color(244, 114, 182); return color(56, 189, 248); } if (theme == 2) { if (k == 8) return color(255, 0, 255); if (k == 7) return color(0, 255, 255); return color(255, 255, 0); } if (k == 1) return color(220, 42, 74); // Proton: Blutrot if (k == 2) return color(185, 198, 220); // Neutron: Silbergrau if (k == 3) return color(65, 145, 255); // Elektron: Blau if (k == 4) return color(255, 215, 55); // Photon: Gold if (k == 5) return color(35, 215, 155); // Gluon: Smaragd if (k == 6) return color(205, 85, 235); // W-Boson: Violett if (k == 7) return color(0, 255, 180); // Vakuum-Quantum: Grün if (k == 8) return color(255, 45, 65); // Singularitäts-Riss: Warnrot return color(255, 135, 55); // Mesonen-Strahl: Orange-Rot } float calcShellEnergyEv(int Z, int electrons, int n) { if (Z <= 0) return -1.5; float zEff = (electrons <= 2) ? max(1.0, float(Z) - 0.30 * float(electrons - 1)) : max(1.15, float(Z) - 0.85 * float(electrons - 1)); return -13.6 * (zEff * zEff) / float(n * n); } void pushBanner(String h, String s) { bannerHead = h; bannerSub = s; bannerFlash = 90; } // ============================================================================================== // INITIALISIERUNG // ============================================================================================== void setup() { size(1120, 740); noSmooth(); frameRate(60); spaceAtoms = new ArrayList(); spaceBonds = new ArrayList(); spaceQuanta = new ArrayList(); spaceRifts = new ArrayList(); spaceShots = new ArrayList(); shockRings = new ArrayList(); initTechNodes(); initVoxelBase(); seedCosmosWorld(); setWelcomeBanner(); } void setWelcomeBanner() { bannerHead = tr( "Norn-Crew bereit: Beschieße Mehrschalen-Atome für Erz & Quanta — fliege über Basis Alpha & Beta!", "Norn crew ready: Harvest multi-shell atoms for Ore & Quanta — fly over Bases Alpha & Beta!" ); bannerSub = tr( "100 Erz = +1 Erz-Würfel | 100 FP = +1 Forschungs-Würfel · [T] Tech-Tree | [B] 3D-Basis | [V] 3D-Begehung", "100 Ore = +1 Ore Cube | 100 RP = +1 Research Cube · [T] Tech Tree | [B] 3D Base | [V] 3D Walk" ); } void initTechNodes() { setTech(0, "A1", "120°-Waben-Kopplung", "120° Honeycomb Coupling", "Antrieb", "Drive", 0, 0, -1, 15, "Verankert das Norn-Schiff auf dem diskreten Gitter (+15% Tempo).", "Anchors the Norn ship on the discrete lattice (+15% speed)."); setTech(1, "A2", "ALDI-YBCO Supraleiter-Ring", "ALDI-YBCO Superconductor Ring", "Antrieb", "Drive", 0, 1, 0, 30, "Spartanischer Heckring für asymmetrischen Phasengradienten (+25% Schub).", "Spartan stern ring for asymmetric phase gradient (+25% thrust)."); setTech(2, "A3", "Adjacency-Fold-Drive (0.0 G)", "Adjacency Fold Drive (0.0 G)", "Antrieb", "Drive", 0, 2, 1, 55, "Trägheitslose Gitter-Faltung im Sub-Atomraum (+35% Max-Tempo).", "Inertialess lattice folding in sub-atomic space (+35% max speed)."); setTech(3, "B1", "Bohr-Slater Resonanz-Photon", "Bohr-Slater Resonance Photon", "Waffen", "Weapons", 1, 0, -1, 15, "Stimmt Photonen auf Elektronenschalen-Übergänge ab (+Spontan-Emission).", "Tunes photons to electron shell transitions (+spontaneous emission)."); setTech(4, "B2", "Mesonenkanone (Pi+/- Salve)", "Meson Cannon (Pi+/- Salvo)", "Waffen", "Weapons", 1, 1, 3, 30, "Löst Risse auf & sprengt Atomkerne für Erz; ab Stufe 2 Doppelsalve!", "Dissolves rifts & shatters nuclei for Ore; Level 2 fires twin salvos!"); setTech(5, "B3", "Gluon- & W-Boson-Injektor", "Gluon & W-Boson Injector", "Waffen", "Weapons", 1, 2, 4, 55, "Extrahiert doppelte Erz- & Isotopen-Ausbeute aus schweren Kernen.", "Extracts double Ore & isotope yield from heavy atomic nuclei."); setTech(6, "C1", "CNT-Aerogel-Panzerung", "CNT Aerogel Armor", "Panzerung", "Armor", 2, 0, -1, 15, "Nanoröhren-Panzerung erhöht Hüllenintegrität (+45 Max-HP pro Stufe).", "Carbon nanotube armor increases hull integrity (+45 Max HP per level)."); setTech(7, "C2", "Zeno-Stasis-Deflektorschild", "Zeno-Stasis Deflector Shield", "Panzerung", "Armor", 2, 1, 6, 35, "Gigahertz-Stasis-Schild dämpft Riss-Kollisionen um 50%.", "Gigahertz stasis shield dampens rift collisions by 50%."); setTech(8, "C3", "EVM-Void-Riss-Absorber", "EVM Void Rift Absorber", "Panzerung", "Armor", 2, 2, 7, 60, "Leitet Einschlagenergie über den Extended Void Mechanism ab.", "Routes impact energy into the intergalactic void via EVM."); setTech(9, "D1", "Norn-Biochemie-Pilot (ATP)", "Norn Biochemistry Pilot (ATP)", "Norn-Crew", "Norn Crew", 3, 0, -1, 15, "Norn-Crew erzeugt kontinuierlich Forschungspunkte über ATP-Synthese.", "Norn crew continuously generates Research Points via ATP synthesis."); setTech(10, "D2", "Quanten-Traktor & Chargo", "Quantum Tractor & Chargo", "Norn-Crew", "Norn Crew", 3, 1, 9, 30, "Zieht Erz & Quanta aus weitem Radius an und vergrößert Chargo (+40/Stufe).", "Pulls Ore & Quanta from wide radius and expands Chargo (+40/level)."); setTech(11, "D3", "Plasma-Synthesizer (Waste)", "Plasma Synthesizer (Waste)", "Norn-Crew", "Norn Crew", 3, 2, 10, 50, "Wandelt Entropie-Waste auf Basis Beta automatisch in Erz + FP um.", "Automatically converts entropy Waste at Base Beta into Ore + RP."); for (int i = 0; i < NUM_TECH; i++) tLevel[i] = 0; tLevel[0] = 1; tLevel[4] = 1; tLevel[9] = 1; recalcShipCapabilities(); } void setTech(int idx, String c, String tiDe, String tiEn, String brDe, String brEn, int bId, int tr, int pre, int cost, String dDe, String dEn) { tCode[idx] = c; tTitleDe[idx] = tiDe; tTitleEn[idx] = tiEn; tBranchDe[idx] = brDe; tBranchEn[idx] = brEn; tBranchId[idx] = bId; tTier[idx] = tr; tPrereq[idx] = pre; tCost[idx] = cost; tDescDe[idx] = dDe; tDescEn[idx] = dEn; } void recalcShipCapabilities() { maxHullHP = 100 + tLevel[6] * 45; hullHP = min(maxHullHP, hullHP); chargoMax = 80 + tLevel[10] * 40; } void seedCosmosWorld() { spaceAtoms.clear(); spaceBonds.clear(); spaceQuanta.clear(); spaceRifts.clear(); spaceShots.clear(); shockRings.clear(); for (int i = 0; i < 34; i++) { spaceQuanta.add(new VacuumQuantum(random(-HALF_WORLD + 120, HALF_WORLD - 120), random(-HALF_WORLD + 120, HALF_WORLD - 120))); } for (int i = 0; i < 18; i++) { float rx = random(-HALF_WORLD + 160, HALF_WORLD - 160); float ry = random(-HALF_WORLD + 160, HALF_WORLD - 160); if (dist(0, 0, rx, ry) > 260.0 && dist(baseAlphaX, baseAlphaY, rx, ry) > 260.0 && dist(baseBetaX, baseBetaY, rx, ry) > 260.0) { spaceRifts.add(new SingularityRift(rx, ry)); } } // Direkt nahe dem Startpunkt: Ein kovalentes H2-Molekülpaar + ein Kohlenstoff C-12 Atom als Rohstoffquelle! spaceAtoms.add(new MultiShellAtom(195, -55, 1, 0, 1)); spaceAtoms.add(new MultiShellAtom(285, -55, 1, 0, 1)); spaceAtoms.add(new MultiShellAtom(-210, -85, 6, 6, 6)); // Weitere Mehrschalen-Atome (H-1, He-4, Li-7, C-12, O-16) im gesamten Mikrokosmos verteilen for (int i = 0; i < 26; i++) { float ax = random(-HALF_WORLD + 180, HALF_WORLD - 180); float ay = random(-HALF_WORLD + 180, HALF_WORLD - 180); if (dist(0, 0, ax, ay) < 250.0) continue; if (dist(baseAlphaX, baseAlphaY, ax, ay) < 220.0) continue; if (dist(baseBetaX, baseBetaY, ax, ay) < 220.0) continue; int kindRoll = i % 5; if (kindRoll == 0) spaceAtoms.add(new MultiShellAtom(ax, ay, 1, 0, 1)); // H-1 (Wasserstoff) else if (kindRoll == 1) spaceAtoms.add(new MultiShellAtom(ax, ay, 2, 2, 2)); // He-4 (Helium) else if (kindRoll == 2) spaceAtoms.add(new MultiShellAtom(ax, ay, 3, 4, 2)); // Li-7+ (Lithium-Ion) else if (kindRoll == 3) spaceAtoms.add(new MultiShellAtom(ax, ay, 6, 6, 6)); // C-12 (Kohlenstoff: 2 + 4 e-) else spaceAtoms.add(new MultiShellAtom(ax, ay, 8, 8, 8)); // O-16 (Sauerstoff: 2 + 6 e-) } } // ============================================================================================== // 3D VOXEL-BASIS WACHSTUM (100 ERZ = 1 ERZ-WÜRFEL | 100 FP = 1 FORSCHUNGS-WÜRFEL) // ============================================================================================== void initVoxelBase() { for (int i = 0; i < baseVoxels.length; i++) baseVoxels[i] = 0; erzCubesCount = 0; fpCubesCount = 0; setBaseVoxel(1, 1, 0, 1); setBaseVoxel(BASE_DIM - 2, 1, 0, 1); setBaseVoxel(1, BASE_DIM - 2, 0, 2); setBaseVoxel(BASE_DIM - 2, BASE_DIM - 2, 0, 2); } int getBaseVoxel(int x, int y, int z) { if (x < 0 || x >= BASE_DIM || y < 0 || y >= BASE_DIM || z < 0 || z >= BASE_HEIGHT) return -1; return baseVoxels[x + y * BASE_DIM + z * BASE_DIM * BASE_DIM]; } void setBaseVoxel(int x, int y, int z, int val) { if (x < 0 || x >= BASE_DIM || y < 0 || y >= BASE_DIM || z < 0 || z >= BASE_HEIGHT) return; baseVoxels[x + y * BASE_DIM + z * BASE_DIM * BASE_DIM] = val; } void checkBaseVoxelMilestones() { while (totalErzBuilt >= (erzCubesCount + 1) * 100) { erzCubesCount++; growVoxelCubeInBase(1); pushBanner( tr("3D-BASIS GEWACHSEN! +1 Erz-Würfel (Gesamt: " + erzCubesCount + ")", "3D BASE EXPANDED! +1 Ore Cube (Total: " + erzCubesCount + ")"), tr("Besuche deine Basis unter [B] 3D-Basis oder [V] 3D-Begehung!", "Inspect your citadel in [B] 3D Base or [V] 3D Walk!") ); } while (totalFPBuilt >= (fpCubesCount + 1) * 100) { fpCubesCount++; growVoxelCubeInBase(2); pushBanner( tr("3D-BASIS GEWACHSEN! +1 Forschungs-Würfel (Gesamt: " + fpCubesCount + ")", "3D BASE EXPANDED! +1 Research Cube (Total: " + fpCubesCount + ")"), tr("Neuer blauer Kristallblock im Forschungsflügel errichtet!", "New blue crystal block constructed in the research wing!") ); } } void growVoxelCubeInBase(int cubeType) { for (int z = 0; z < BASE_HEIGHT; z++) { for (int r = 2; r <= 5; r++) { for (int y = 7 - r; y <= 7 + r; y++) { for (int x = 7 - r; x <= 7 + r; x++) { if (x <= 0 || x >= BASE_DIM - 1 || y <= 0 || y >= BASE_DIM - 1) continue; if (z == 0 && (x == 7 || y == 7 || (abs(x - 7) <= 1 && abs(y - 7) <= 1))) continue; if (cubeType == 1 && x < 7 && z == 0) continue; if (cubeType == 2 && x > 7 && z == 0) continue; if (getBaseVoxel(x, y, z) == 0) { if (z == 0 || getBaseVoxel(x, y, z - 1) > 0) { setBaseVoxel(x, y, z, cubeType); return; } } } } } } for (int z = 0; z < BASE_HEIGHT; z++) { for (int y = 1; y < BASE_DIM - 1; y++) { for (int x = 1; x < BASE_DIM - 1; x++) { if (x == 7 || y == 7) continue; if (getBaseVoxel(x, y, z) == 0) { setBaseVoxel(x, y, z, cubeType); return; } } } } } // ============================================================================================== // HAUPTSCHLEIFE // ============================================================================================== void draw() { background(getUiPalette(a11yTheme, 0)); simTime += 0.025; if (!languageChosen) { drawLanguageSelectionGate(); return; } if (tLevel[9] > 0) { nornAtpPulse += 0.12 * tLevel[9]; if (nornAtpPulse >= 100.0) { nornAtpPulse = 0.0; addResearchFP(2 * tLevel[9]); } } if (viewMode == 0) drawFlightMode(); else if (viewMode == 1) drawTechTreeMode(); else if (viewMode == 2) drawIsometricBaseMode(); else if (viewMode == 3) drawWalk3DBaseMode(); drawGlobalTopBar(); } void addResearchFP(int amount) { researchFP += amount; totalFPBuilt += amount; checkBaseVoxelMilestones(); } void addRefinedErz(int amount) { refinedErz += amount; totalErzBuilt += amount; checkBaseVoxelMilestones(); } // ============================================================================================== // START-DIALOG: SPRACHWAHL (DEUTSCH / ENGLISH) VOR SPIELBEGINN // ============================================================================================== void drawLanguageSelectionGate() { // Lebendiger Hintergrund mit hexagonalem Gitter drawSpacetimeHexGrid(); fill(4, 5, 12, 215); noStroke(); rect(0, 0, width, height); int mx = 210; int my = 125; int mw = width - 420; int mh = 480; fill(getUiPalette(a11yTheme, 1)); stroke(getUiPalette(a11yTheme, 4)); strokeWeight(2.0); rect(mx, my, mw, mh, 10); strokeWeight(1.0); fill(getUiPalette(a11yTheme, 2)); noStroke(); rect(mx + 1, my + 1, mw - 2, 48, 9); fill(255); textSize(17); textAlign(CENTER, CENTER); text("DTIM-ZEC NORN ATOM-STARSHIP · SPRACHE / LANGUAGE", width * 0.5, my + 25); fill(242, 246, 255); textSize(13); textAlign(LEFT, TOP); text("DEUTSCH:\n" + "Steuere das atomgroße Norn-Raumschiff durch das 120°-Raumzeit-Gitter. " + "Ernte Roh-Erz und Quanten aus echten Mehrschalen-Atomen (H-1, He-4, C-12, O-16), " + "verarbeite sie per 0-Klick-Überflug auf Basis Alpha & Beta und lass deine " + "3D-Raumbasis Würfel für Würfel wachsen!\n\n" + "ENGLISH:\n" + "Pilot the atom-sized Norn starship through the 120° spacetime lattice. " + "Harvest raw Ore and Quanta from multi-shell atoms (H-1, He-4, C-12, O-16), " + "refine them via 0-click flyover at Bases Alpha & Beta, and grow your " + "3D voxel citadel cube by cube!", mx + 30, my + 68, mw - 60, 260); // Zwei große Sprach-Start-Buttons drawBigGateBtn(mx + 35, my + 345, 295, 64, "DEUTSCH STARTEN ▶", getUiPalette(a11yTheme, 2)); drawBigGateBtn(mx + 370, my + 345, 295, 64, "START IN ENGLISH ▶", getUiPalette(a11yTheme, 3)); String a11yTxt = "Sehhilfe / Accessibility [H]: " + (a11yTheme == 0 ? "Standard" : (a11yTheme == 1 ? "Colorblind (Blue/Gold)" : "Max-Contrast")); drawNavBtn(int(width * 0.5 - 165), my + 426, 330, 32, a11yTxt, color(28, 35, 52)); } void drawBigGateBtn(int bx, int by, int bw, int bh, String lbl, int bg) { if (a11yTheme == 2) { fill(0); stroke(255, 255, 0); } else { fill(bg); stroke(220, 232, 250); } strokeWeight(1.8); rect(bx, by, bw, bh, 7); strokeWeight(1.0); fill(a11yTheme == 2 ? color(255, 255, 0) : color(255)); textSize(16); textAlign(CENTER, CENTER); text(lbl, bx + bw * 0.5, by + bh * 0.5); } // ============================================================================================== // GLOBALE TOP-LEISTE // ============================================================================================== void drawGlobalTopBar() { fill(getUiPalette(a11yTheme, 1)); noStroke(); rect(0, 0, width, 38); stroke(getUiPalette(a11yTheme, 4)); line(0, 38, width, 38); drawNavBtn(10, 5, 134, 28, tr("[1] Mikrokosmos", "[1] Micro-Cosmos"), viewMode == 0 ? getUiPalette(a11yTheme, 2) : color(22, 28, 42)); drawNavBtn(150, 5, 128, 28, "[T] Tech-Tree", viewMode == 1 ? getUiPalette(a11yTheme, 2) : color(22, 28, 42)); drawNavBtn(284, 5, 146, 28, tr("[B] 3D-Basis (" + (erzCubesCount + fpCubesCount) + ")", "[B] 3D Base (" + (erzCubesCount + fpCubesCount) + ")"), viewMode == 2 ? getUiPalette(a11yTheme, 2) : color(22, 28, 42)); drawNavBtn(436, 5, 136, 28, tr("[V] 3D-Begehung", "[V] 3D Walk"), viewMode == 3 ? getUiPalette(a11yTheme, 2) : color(22, 28, 42)); fill(255); textSize(11); textAlign(LEFT, CENTER); String resStr = tr("Erz: ", "Ore: ") + refinedErz + " (" + erzCubesCount + ") | FP: " + researchFP + " (" + fpCubesCount + ") | " + creditsEUR + " EUR"; text(resStr, 582, 19); drawNavBtn(width - 196, 5, 62, 28, langMode == 0 ? "DE [L]" : "EN [L]", color(30, 38, 56)); String a11yLbl = (a11yTheme == 0) ? tr("Sehhilfe", "A11y") : ((a11yTheme == 1) ? tr("Blau/Gold", "Blue/Gold") : tr("Kontrast", "Contrast")); drawNavBtn(width - 128, 5, 118, 28, a11yLbl + " [H]", getUiPalette(a11yTheme, 3)); } void drawNavBtn(int bx, int by, int bw, int bh, String lbl, int bg) { if (a11yTheme == 2) { fill(0); stroke(255, 255, 0); } else { fill(bg); stroke(125, 160, 220); } rect(bx, by, bw, bh, 5); fill(a11yTheme == 2 ? color(255, 255, 0) : color(255)); textSize(11); textAlign(CENTER, CENTER); text(lbl, bx + bw * 0.5, by + bh * 0.5); } // ============================================================================================== // MODE 0: MIKROKOSMOS-FLUG, MEHRSCHALEN-ATOME & 0-KLICK-RAUMBASEN // ============================================================================================== void drawFlightMode() { float speedMult = 1.0 + tLevel[0] * 0.15 + tLevel[1] * 0.25 + tLevel[2] * 0.35; updateShipKinematics(speedMult); updateAutoAimTarget(); updateAtomsAndSpaceEntities(); processZeroClickBases(); if (zeroClick) { if (autoFireTimer > 0) autoFireTimer--; if (lockedAtom != null && autoFireTimer <= 0) { fireActiveWeapon(); autoFireTimer = 22; } } camX = lerp(camX, shipX, 0.12); camY = lerp(camY, shipY, 0.12); pushMatrix(); translate(width * 0.5 - camX, (height - 130) * 0.5 - camY); drawSpacetimeHexGrid(); drawSpaceBases(); drawCovalentBonds(); drawSpaceEntities(); drawAimBeam(); pushMatrix(); translate(shipX, shipY); rotate(shipAngle); drawNornStarship(); popMatrix(); popMatrix(); drawFlightHUD(); } void drawSpacetimeHexGrid() { int step = 46; int startX = floor((camX - width * 0.6) / step) * step; int endX = ceil((camX + width * 0.6) / step) * step; int startY = floor((camY - height * 0.6) / step) * step; int endY = ceil((camY + height * 0.6) / step) * step; for (int gx = startX; gx <= endX; gx += step) { for (int gy = startY; gy <= endY; gy += step) { float dx = shipX - gx; float dy = shipY - gy; float d = max(0.1, sqrt(dx * dx + dy * dy)); float comp = (d < 180.0) ? map(d, 0, 180, 16.0, 0.0) : 0.0; float px = gx + (dx / d) * comp; float py = gy + (dy / d) * comp; stroke(45, 85, 195, constrain(map(d, 0, 460, 48, 12), 10, 65)); noFill(); beginShape(); for (int i = 0; i < 6; i++) { float a = (PI / 3.0) * i + simTime * 0.02; vertex(px + cos(a) * 23.0, py + sin(a) * 23.0); } endShape(CLOSE); } } } void drawSpaceBases() { // --- BASIS ALPHA (NO): ERZ-RAFFINERIE, MARKT & WERFT --- pushMatrix(); translate(baseAlphaX, baseAlphaY); fill(14, 18, 28, 225); stroke(225, 55, 85); strokeWeight(2.0); rect(-175, -125, 350, 250, 10); strokeWeight(1.0); fill(255); textSize(12); textAlign(CENTER, TOP); text(tr("BASIS ALPHA: ERZ-RAFFINERIE (0-Klick Überflug)", "BASE ALPHA: ORE REFINERY (0-Click Flyover)"), 0, -116); drawBasePad(-155, -80, 145, 78, color(122, 16, 38), tr("1. Erz-Schmelze", "1. Ore Smelter"), tr("Roh-Erz -> Bau-Erz\n(100 = +1 3D-Würfel)", "Raw Ore -> Refined Ore\n(100 = +1 3D Cube)")); drawBasePad(10, -80, 145, 78, color(18, 46, 98), tr("2. Handels-Dock", "2. Trade Dock"), tr("Verkauft Erz-Überschuss\nfür EUR Credits", "Sells surplus Ore\nfor EUR credits")); drawBasePad(-155, 15, 310, 88, color(20, 105, 65), tr("3. Werft- & Reparatur-Dock", "3. Shipyard & Repair Dock"), tr("Repariert Hülle · Erz-Würfel in 3D-Basis: " + erzCubesCount, "Repairs hull · Ore cubes in 3D base: " + erzCubesCount)); popMatrix(); // --- BASIS BETA (SW): NORN-FORSCHUNGSSTATION & PLASMA-LABOR --- pushMatrix(); translate(baseBetaX, baseBetaY); fill(14, 18, 28, 225); stroke(56, 189, 248); strokeWeight(2.0); rect(-175, -125, 350, 250, 10); strokeWeight(1.0); fill(255); textSize(12); textAlign(CENTER, TOP); text(tr("BASIS BETA: FORSCHUNGSSTATION (0-Klick Überflug)", "BASE BETA: RESEARCH STATION (0-Click Flyover)"), 0, -116); drawBasePad(-155, -80, 145, 78, color(18, 46, 98), tr("1. Quanten-Labor", "1. Quantum Lab"), tr("Quanta -> Forschung (FP)\n(100 = +1 3D-Würfel)", "Quanta -> Research (RP)\n(100 = +1 3D Cube)")); drawBasePad(10, -80, 145, 78, color(122, 16, 38), tr("2. Plasma-Synthese", "2. Plasma Synthesis"), tr("Recycelt Waste (" + wasteEntropy + ")\nin Erz + FP", "Recycles Waste (" + wasteEntropy + ")\ninto Ore + RP")); drawBasePad(-155, 15, 310, 88, color(145, 100, 18), tr("3. Norn-Biochemie-Kuppel", "3. Norn Biochemistry Dome"), tr("ATP-Boost · [T] Tech-Tree | [B] 3D-Basis | [V] 3D-Walk", "ATP Boost · [T] Tech Tree | [B] 3D Base | [V] 3D Walk")); popMatrix(); } void drawBasePad(float px, float py, float pw, float ph, int col, String title, String desc) { fill(col); stroke(220, 232, 250); rect(px, py, pw, ph, 6); fill(255); textSize(12); textAlign(CENTER, TOP); text(title, px + pw * 0.5, py + 8); fill(235, 242, 255); textSize(10); text(desc, px + pw * 0.5, py + 30); } void processZeroClickBases() { float ax = shipX - baseAlphaX; float ay = shipY - baseAlphaY; if (abs(ax) < 175 && abs(ay) < 125) { if (ax >= -155 && ax <= -10 && ay >= -80 && ay <= -2) { if (rawErz > 0 && frameCount % 8 == 0) { int batch = min(5, rawErz); rawErz -= batch; addRefinedErz(batch * 2); pushBanner( tr("Erz-Schmelze (0-Klick): +" + (batch * 2) + " Bau-Erz verarbeitet! (" + (totalErzBuilt % 100) + "/100)", "Ore Smelter (0-Click): +" + (batch * 2) + " Refined Ore processed! (" + (totalErzBuilt % 100) + "/100)"), tr("Alle 100 Erz wächst ein neuer Erz-Würfel in deiner 3D-Basis [B]!", "Every 100 Ore grows a new Ore Cube in your 3D Base [B]!") ); } } if (ax >= 10 && ax <= 155 && ay >= -80 && ay <= -2) { if (refinedErz >= 20 && frameCount % 18 == 0) { refinedErz -= 20; creditsEUR += 15; pushBanner( tr("Handels-Dock (0-Klick): 20 Erz für +15 EUR verkauft! (Guthaben: " + creditsEUR + " EUR)", "Trade Dock (0-Click): Sold 20 Ore for +15 EUR! (Balance: " + creditsEUR + " EUR)"), tr("Im Tech-Tree [T] kannst du EUR in Forschungspunkte tauschen.", "Exchange EUR for Research Points inside the Tech Tree [T].") ); } } if (ax >= -155 && ax <= 155 && ay >= 15 && ay <= 103) { if (hullHP < maxHullHP && frameCount % 6 == 0) { hullHP = min(maxHullHP, hullHP + 2); } } } float bx = shipX - baseBetaX; float by = shipY - baseBetaY; if (abs(bx) < 175 && abs(by) < 125) { if (bx >= -155 && bx <= -10 && by >= -80 && by <= -2) { if (rawQuanta > 0 && frameCount % 12 == 0) { rawQuanta--; int fpGain = 14 + tLevel[9] * 4; addResearchFP(fpGain); pushBanner( tr("Quanten-Labor (0-Klick): Quantum analysiert -> +" + fpGain + " FP! (" + (totalFPBuilt % 100) + "/100)", "Quantum Lab (0-Click): Quantum analyzed -> +" + fpGain + " RP! (" + (totalFPBuilt % 100) + "/100)"), tr("Alle 100 FP wächst ein neuer blauer Forschungs-Würfel in deiner 3D-Basis!", "Every 100 RP grows a new blue Research Cube in your 3D Base!") ); } } if (bx >= 10 && bx <= 155 && by >= -80 && by <= -2) { if (wasteEntropy > 0 && frameCount % 12 == 0) { wasteEntropy--; addRefinedErz(8); addResearchFP(8); pushBanner( tr("Plasma-Synthese (0-Klick): Waste recycelt -> +8 Erz & +8 FP!", "Plasma Synthesis (0-Click): Waste recycled -> +8 Ore & +8 RP!"), tr("DTIM-ZEC Kreislaufwirtschaft aktiv.", "DTIM-ZEC closed-loop recycling active.") ); } } if (bx >= -155 && bx <= 155 && by >= 15 && by <= 103) { if (frameCount % 25 == 0) addResearchFP(2); } } } void updateShipKinematics(float speedMult) { float maxSpd = 4.3 * speedMult; if (keyTurnL) shipAngle -= 0.055; if (keyTurnR) shipAngle += 0.055; if (keyW || keyS) { mouseSteer = false; float thrust = keyW ? 0.25 : -0.16; shipVX += cos(shipAngle) * thrust; shipVY += sin(shipAngle) * thrust; } else if (mouseSteer && mouseY > 40 && mouseY < height - 130) { float sx = width * 0.5 + (shipX - camX); float sy = (height - 130) * 0.5 + (shipY - camY); float dx = mouseX - sx; float dy = mouseY - sy; float d = sqrt(dx * dx + dy * dy); if (d > 18.0) { float targetA = atan2(dy, dx); float diff = atan2(sin(targetA - shipAngle), cos(targetA - shipAngle)); shipAngle += diff * 0.12; float throttle = constrain((d - 18.0) / 140.0, 0.0, 1.0) * 0.22; shipVX += cos(shipAngle) * throttle; shipVY += sin(shipAngle) * throttle; } } shipVX *= 0.95; shipVY *= 0.95; float sp = sqrt(shipVX * shipVX + shipVY * shipVY); if (sp > maxSpd) { shipVX = (shipVX / sp) * maxSpd; shipVY = (shipVY / sp) * maxSpd; } shipX = constrain(shipX + shipVX, -HALF_WORLD + 60, HALF_WORLD - 60); shipY = constrain(shipY + shipVY, -HALF_WORLD + 60, HALF_WORLD - 60); } void updateAutoAimTarget() { lockedAtom = null; float bestD = 360.0; for (int i = 0; i < spaceAtoms.size(); i++) { MultiShellAtom a = (MultiShellAtom) spaceAtoms.get(i); if (a.destroyed) continue; float d = dist(shipX, shipY, a.x, a.y); if (d < bestD) { bestD = d; lockedAtom = a; } } if (autoAim && lockedAtom != null) { aimAngle = atan2(lockedAtom.y - shipY, lockedAtom.x - shipX); int curN = min(3, lockedAtom.getOuterShell() + lockedAtom.excitedLevel); float e1 = calcShellEnergyEv(lockedAtom.protons, lockedAtom.electrons, curN); float e2 = calcShellEnergyEv(lockedAtom.protons, lockedAtom.electrons, min(3, curN + 1)); currentEv = max(0.5, e2 - e1); String bondTag = (lockedAtom.bondCount > 0) ? tr(" [Kovalent]", " [Covalent]") : ""; sensorInfo = lockedAtom.getSymbol() + bondTag + " · " + tr("Erz-Vorrat: ", "Ore Reserve: ") + lockedAtom.oreReserve + " · dE = " + nf(currentEv, 1, 2) + " eV"; } else { aimAngle = shipAngle; sensorInfo = tr("Sensoren scannen Mehrschalen-Atome · Basis Alpha (NO) & Beta (SW)", "Sensors scanning multi-shell atoms · Base Alpha (NE) & Beta (SW)"); } } void drawAimBeam() { if (!autoAim || lockedAtom == null) return; stroke(getKindColor(a11yTheme, activeWeapon == 5 ? 9 : 4)); strokeWeight(1.5); line(shipX, shipY, lockedAtom.x, lockedAtom.y); noFill(); ellipse(lockedAtom.x, lockedAtom.y, 92, 92); strokeWeight(1.0); } void drawNornStarship() { if (tLevel[7] > 0) { noFill(); stroke(45, 210, 145, 160); strokeWeight(1.8); ellipse(0, 0, 114, 70); } stroke(0, 255, 180); strokeWeight(2.0 + tLevel[1] * 0.5); fill(18, 28, 45); ellipse(-26, 0, 16, 48 + tLevel[1] * 4); fill(235, 240, 250); stroke(tLevel[6] > 0 ? color(45, 210, 145) : color(30, 42, 60)); strokeWeight(1.5 + tLevel[6] * 0.8); beginShape(); vertex(-30, -10 - tLevel[6]); vertex(24, -8 - tLevel[6]); vertex(64, 0); vertex(24, 8 + tLevel[6]); vertex(-30, 10 + tLevel[6]); vertex(-16, 0); endShape(CLOSE); if (tLevel[4] > 0) { fill(getKindColor(a11yTheme, 9)); stroke(255); rect(8, -16, 20 + tLevel[4] * 4, 4); rect(8, 12, 20 + tLevel[4] * 4, 4); } fill(235, 185, 110); noStroke(); ellipse(-2, 0, 10, 8); strokeWeight(1.0); } void fireActiveWeapon() { float nx = shipX + cos(shipAngle) * 42.0; float ny = shipY + sin(shipAngle) * 42.0; int kind = (activeWeapon == 5) ? 9 : (activeWeapon == 1 ? 4 : (activeWeapon == 2 ? 5 : (activeWeapon == 3 ? 6 : 3))); spaceShots.add(new BosonShot(nx, ny, cos(aimAngle) * 11.0, sin(aimAngle) * 11.0, kind)); if (activeWeapon == 5 && tLevel[4] >= 2) { float px = -sin(aimAngle) * 8.0; float py = cos(aimAngle) * 8.0; spaceShots.add(new BosonShot(nx + px, ny + py, cos(aimAngle) * 11.0, sin(aimAngle) * 11.0, 9)); } } // ============================================================================================== // MEHRSCHALEN-ATOME & KOVALENTE BINDUNGEN ALS ROHSTOFFQUELLEN // ============================================================================================== class MultiShellAtom { float x, y, vx, vy; int protons; int neutrons; int electrons; int oreReserve; int maxOre; int excitedLevel; int exciteTimer; int bondCount; float orbitPhase; boolean destroyed; MultiShellAtom(float ax, float ay, int p, int n, int e) { x = ax; y = ay; vx = random(-0.28, 0.28); vy = random(-0.28, 0.28); protons = p; neutrons = n; electrons = e; maxOre = (p + n) * 4 + 12; oreReserve = maxOre; excitedLevel = 0; exciteTimer = 0; bondCount = 0; orbitPhase = random(TWO_PI); destroyed = false; } String getSymbol() { int A = protons + neutrons; if (protons == 1) return "H-" + A; if (protons == 2) return "He-" + A; if (protons == 3) return "Li-" + A; if (protons == 6) return "C-" + A; if (protons == 8) return "O-" + A; return "Z" + protons + "-" + A; } int getOuterShell() { if (electrons <= 2) return 1; if (electrons <= 10) return 2; return 3; } int getMaxBonds() { if (protons == 1 && electrons == 1) return 1; if (protons == 6 && electrons >= 4) return 2; if (protons == 8 && electrons >= 6) return 2; return 0; } } class AtomBond { MultiShellAtom a; MultiShellAtom b; AtomBond(MultiShellAtom atomA, MultiShellAtom atomB) { a = atomA; b = atomB; } } void updateAtomsAndSpaceEntities() { spaceBonds.clear(); float traktorR = 45.0 + tLevel[10] * 45.0; // 1. Atome bewegen, spontane Photonen-Emission & Erz-Regeneration for (int i = spaceAtoms.size() - 1; i >= 0; i--) { MultiShellAtom a = (MultiShellAtom) spaceAtoms.get(i); if (a.destroyed) { spaceAtoms.remove(i); continue; } a.bondCount = 0; a.orbitPhase += 0.04; a.x += a.vx; a.y += a.vy; if (a.x < -HALF_WORLD + 110 || a.x > HALF_WORLD - 110) a.vx = -a.vx; if (a.y < -HALF_WORLD + 110 || a.y > HALF_WORLD - 110) a.vy = -a.vy; // Langsame natürliche Gitter-Regeneration des Erz-Vorrats if (a.oreReserve < a.maxOre && frameCount % 90 == 0) { a.oreReserve++; } // Spontane Emission nach Photonen-Anregung -> erzeugt einsammelbares Vakuum-Quantum! if (a.excitedLevel > 0 && a.electrons > 0) { a.exciteTimer--; if (a.exciteTimer <= 0) { a.excitedLevel = 0; spaceQuanta.add(new VacuumQuantum(a.x + random(-28, 28), a.y + random(-28, 28))); shockRings.add(new ShockRing(a.x, a.y, getKindColor(a11yTheme, 4))); } } } // 2. Kovalente Bindungen zwischen nahegelegenen Atomen bilden (wie in DTIM_ZEC_DOOM_Constructor) for (int i = 0; i < spaceAtoms.size(); i++) { MultiShellAtom a1 = (MultiShellAtom) spaceAtoms.get(i); for (int j = i + 1; j < spaceAtoms.size(); j++) { MultiShellAtom a2 = (MultiShellAtom) spaceAtoms.get(j); float dx = a2.x - a1.x; float dy = a2.y - a1.y; float d = max(1.0, sqrt(dx * dx + dy * dy)); if (a1.bondCount < a1.getMaxBonds() && a2.bondCount < a2.getMaxBonds() && d >= 65.0 && d <= 145.0) { spaceBonds.add(new AtomBond(a1, a2)); a1.bondCount++; a2.bondCount++; float spring = (d - 102.0) * 0.012; a1.vx += (dx / d) * spring; a1.vy += (dy / d) * spring; a2.vx -= (dx / d) * spring; a2.vy -= (dy / d) * spring; } } } // 3. Vakuum-Quanten & Traktorstrahl for (int i = spaceQuanta.size() - 1; i >= 0; i--) { VacuumQuantum q = (VacuumQuantum) spaceQuanta.get(i); float d = dist(shipX, shipY, q.x, q.y); if (d < traktorR && d > 1.0) { q.x += ((shipX - q.x) / d) * (2.0 + tLevel[10] * 0.8); q.y += ((shipY - q.y) / d) * (2.0 + tLevel[10] * 0.8); } if (d < 34.0) { rawQuanta++; q.x = random(-HALF_WORLD + 140, HALF_WORLD - 140); q.y = random(-HALF_WORLD + 140, HALF_WORLD - 140); pushBanner( tr("Vakuum-Quantum gesammelt (Quanta: " + rawQuanta + ") — Fliege zu Basis Beta (SW) für FP!", "Vacuum Quantum collected (Quanta: " + rawQuanta + ") — Fly to Base Beta (SW) for RP!"), tr("Im Quanten-Labor von Basis Beta wird jedes Quantum automatisch zu Forschungspunkten.", "Inside Base Beta's Quantum Lab every quantum automatically refines into Research Points.") ); } } // 4. Singularitäts-Risse for (int i = 0; i < spaceRifts.size(); i++) { SingularityRift r = (SingularityRift) spaceRifts.get(i); r.x += cos(simTime * 1.4 + r.phase) * 0.6; r.y += sin(simTime * 1.7 + r.phase) * 0.6; if (dist(shipX, shipY, r.x, r.y) < 32.0) { int dmg = max(6, 26 - tLevel[6] * 5 - tLevel[7] * 5); hullHP = max(10, hullHP - dmg); wasteEntropy++; r.x = shipX + cos(shipAngle + PI) * 420.0; r.y = shipY + sin(shipAngle + PI) * 420.0; } } // 5. Projektile & Atom-Rohstoff-Ernte for (int i = spaceShots.size() - 1; i >= 0; i--) { BosonShot s = (BosonShot) spaceShots.get(i); s.x += s.vx; s.y += s.vy; s.life--; if (s.life <= 0) { spaceShots.remove(i); continue; } if (s.kind == 9) { boolean hitR = false; for (int r = 0; r < spaceRifts.size(); r++) { SingularityRift rf = (SingularityRift) spaceRifts.get(r); if (dist(s.x, s.y, rf.x, rf.y) < 30.0) { shockRings.add(new ShockRing(rf.x, rf.y, getKindColor(a11yTheme, 9))); rf.x = random(-HALF_WORLD + 160, HALF_WORLD - 160); rf.y = random(-HALF_WORLD + 160, HALF_WORLD - 160); addResearchFP(10); hitR = true; break; } } if (hitR) { spaceShots.remove(i); continue; } } for (int j = 0; j < spaceAtoms.size(); j++) { MultiShellAtom target = (MultiShellAtom) spaceAtoms.get(j); if (dist(s.x, s.y, target.x, target.y) < 46.0) { harvestFromAtom(s, target); spaceShots.remove(i); break; } } } for (int i = shockRings.size() - 1; i >= 0; i--) { ShockRing r = (ShockRing) shockRings.get(i); r.r += 2.8; r.alpha -= 10; if (r.alpha <= 0) shockRings.remove(i); } } void harvestFromAtom(BosonShot s, MultiShellAtom target) { int bonusMult = 1 + tLevel[5]; if (s.kind == 4) { // PHOTON [1]: Quantensprung auf äußere Schale -> Spontan-Emission von Quanta + FP if (target.electrons > 0) { target.excitedLevel = min(2, target.excitedLevel + 1); target.exciteTimer = 110; int fpGain = (target.bondCount > 0) ? 10 : 6; addResearchFP(fpGain); pushBanner( tr("Quantensprung an " + target.getSymbol() + " (+" + fpGain + " FP) -> Spontane Emission folgt!", "Quantum jump on " + target.getSymbol() + " (+" + fpGain + " RP) -> Spontaneous emission incoming!"), tr("Angeregtes Elektron fällt gleich zurück und erzeugt ein Vakuum-Quantum.", "Excited electron will decay shortly and release a Vacuum Quantum.") ); } } else if (s.kind == 5 || s.kind == 9) { // GLUON [2] oder MESONENKANONE [5]: Kern-Erz-Extraktion! int wanted = ((s.kind == 9) ? 16 : 12) * bonusMult; int mined = min(target.oreReserve, wanted); if (mined > 0) { target.oreReserve -= mined; rawErz = min(chargoMax, rawErz + mined); if (s.kind == 9) wasteEntropy++; pushBanner( tr("Erz-Extraktion aus " + target.getSymbol() + ": +" + mined + " Roh-Erz (Fracht: " + rawErz + "/" + chargoMax + ")", "Ore extraction from " + target.getSymbol() + ": +" + mined + " Raw Ore (Cargo: " + rawErz + "/" + chargoMax + ")"), tr("Fliege über Basis Alpha (NO), um das Erz zu schmelzen (100 Erz = +1 3D-Würfel)!", "Fly over Base Alpha (NE) to smelt Ore (100 Ore = +1 3D Cube)!") ); } else { pushBanner( tr(target.getSymbol() + " vorübergehend erschöpft — regeneriert im Raumzeit-Gitter!", target.getSymbol() + " temporarily depleted — regenerating in the spacetime lattice!"), tr("Ziele auf andere Atome (C-12 und O-16 besitzen den größten Erz-Vorrat).", "Target other atoms (C-12 and O-16 hold the largest Ore reserves).") ); } } else if (s.kind == 6) { // W-BOSON [3]: Schwache Wechselwirkung -> Erz + Forschungspunkte int mined = min(target.oreReserve, 10 * bonusMult); target.oreReserve -= mined; rawErz = min(chargoMax, rawErz + mined); addResearchFP(8); pushBanner( tr("W-Boson-Umwandlung an " + target.getSymbol() + ": +" + mined + " Roh-Erz & +8 FP!", "W-Boson transmutation on " + target.getSymbol() + ": +" + mined + " Raw Ore & +8 RP!"), tr("Schwache Wechselwirkung liefert Nukleonendaten und Isotopen-Erz.", "Weak interaction yields nucleon data and isotope Ore.") ); } else { // ELEKTRON [4]: Schalen-Sättigung -> EUR Credits + sauberes Erz creditsEUR += 8; int mined = min(target.oreReserve, 6); target.oreReserve -= mined; rawErz = min(chargoMax, rawErz + mined); pushBanner( tr("Elektronen-Kopplung an " + target.getSymbol() + ": +8 EUR & +" + mined + " Roh-Erz!", "Electron coupling on " + target.getSymbol() + ": +8 EUR & +" + mined + " Raw Ore!"), tr("Saubere Reaktion ohne Entropie-Waste.", "Clean reaction with zero entropy Waste.") ); } shockRings.add(new ShockRing(target.x, target.y, getKindColor(a11yTheme, s.kind))); } void drawCovalentBonds() { int eCol = getKindColor(a11yTheme, 3); int glowC = (a11yTheme == 2) ? color(255, 255, 0) : color(56, 189, 248); for (int i = 0; i < spaceBonds.size(); i++) { AtomBond b = (AtomBond) spaceBonds.get(i); if (abs(b.a.x - camX) > width * 0.7 && abs(b.b.x - camX) > width * 0.7) continue; float mx = (b.a.x + b.b.x) * 0.5; float my = (b.a.y + b.b.y) * 0.5; float dx = b.b.x - b.a.x; float dy = b.b.y - b.a.y; float d = max(1.0, sqrt(dx * dx + dy * dy)); float ang = atan2(dy, dx); pushMatrix(); translate(mx, my); rotate(ang); noFill(); stroke(glowC); strokeWeight(1.5); ellipse(0, 0, d + 40.0, 40.0); strokeWeight(1.0); // Figure-8 Elektronenpaar float t1 = simTime * 2.4 + i; float t2 = t1 + PI; float ex1 = sin(t1) * (d * 0.58); float ey1 = sin(2.0 * t1) * 14.0; float ex2 = sin(t2) * (d * 0.58); float ey2 = sin(2.0 * t2) * 14.0; noStroke(); fill(eCol); ellipse(ex1, ey1, 9, 9); ellipse(ex2, ey2, 9, 9); popMatrix(); } } void drawSpaceEntities() { int qCol = getKindColor(a11yTheme, 7); for (int i = 0; i < spaceQuanta.size(); i++) { VacuumQuantum q = (VacuumQuantum) spaceQuanta.get(i); if (abs(q.x - camX) > width * 0.6 || abs(q.y - camY) > height * 0.6) continue; stroke(qCol); fill(8, 30, 36); ellipse(q.x, q.y, 18, 18); } int rCol = getKindColor(a11yTheme, 8); for (int i = 0; i < spaceRifts.size(); i++) { SingularityRift r = (SingularityRift) spaceRifts.get(i); if (abs(r.x - camX) > width * 0.6 || abs(r.y - camY) > height * 0.6) continue; stroke(rCol); fill(35, 6, 14); ellipse(r.x, r.y, 26, 26); } // Mehrschalen-Atome aus DTIM_ZEC_DOOM_Constructor zeichnen int pCol = getKindColor(a11yTheme, 1); int nCol = getKindColor(a11yTheme, 2); int eCol = getKindColor(a11yTheme, 3); for (int i = 0; i < spaceAtoms.size(); i++) { MultiShellAtom a = (MultiShellAtom) spaceAtoms.get(i); if (abs(a.x - camX) > width * 0.65 || abs(a.y - camY) > height * 0.65) continue; int e1 = min(2, a.electrons); int e2 = max(0, min(8, a.electrons - 2)); if (a.excitedLevel > 0 && e1 > 0) { e1--; e2++; } // Schalen-Ringe n=1 (K) & n=2 (L) noFill(); stroke(eCol); strokeWeight(1.2); ellipse(a.x, a.y, 56, 56); if (e2 > 0) { ellipse(a.x, a.y, 88, 88); } // Elektronen auf K-Schale for (int k = 0; k < e1; k++) { float ang = a.orbitPhase * 1.4 + (TWO_PI * k) / max(1, e1); noStroke(); fill(eCol); ellipse(a.x + cos(ang) * 28.0, a.y + sin(ang) * 28.0, 8, 8); } // Elektronen auf L-Schale for (int k = 0; k < e2; k++) { float ang = -a.orbitPhase + (TWO_PI * k) / max(1, e2); noStroke(); fill(eCol); ellipse(a.x + cos(ang) * 44.0, a.y + sin(ang) * 44.0, 8, 8); } // Kern aus Protonen & Neutronen int totalNuc = a.protons + a.neutrons; for (int k = 0; k < totalNuc; k++) { float offX = 0.0; float offY = 0.0; if (totalNuc > 1) { float kAng = (TWO_PI * k) / float(totalNuc) + simTime * 0.8; float kRad = min(13.0, 3.5 + totalNuc * 0.8); offX = cos(kAng) * kRad; offY = sin(kAng) * kRad; } fill(k < a.protons ? pCol : nCol); stroke(255, 140); ellipse(a.x + offX, a.y + offY, 12, 12); } // Element- & Erz-Anzeige unter dem Atom float labelY = a.y + ((e2 > 0) ? 50.0 : 34.0); fill(245); textSize(10); textAlign(CENTER, TOP); text(a.getSymbol() + " · " + tr("Erz: ", "Ore: ") + a.oreReserve, a.x, labelY); } for (int i = 0; i < spaceShots.size(); i++) { BosonShot s = (BosonShot) spaceShots.get(i); fill(getKindColor(a11yTheme, s.kind)); stroke(255); ellipse(s.x, s.y, 11, 11); } for (int i = 0; i < shockRings.size(); i++) { ShockRing r = (ShockRing) shockRings.get(i); noFill(); stroke(red(r.col), green(r.col), blue(r.col), r.alpha); ellipse(r.x, r.y, r.r * 2.0, r.r * 2.0); } strokeWeight(1.0); } void drawFlightHUD() { int hudTop = height - 130; fill(getUiPalette(a11yTheme, 1)); noStroke(); rect(0, hudTop, width, 130); stroke(getUiPalette(a11yTheme, 4)); line(0, hudTop, width, hudTop); fill(255); textSize(11); textAlign(LEFT, TOP); String topStats = tr("Hülle: ", "Hull: ") + hullHP + "/" + maxHullHP + tr(" | Roh-Erz: ", " | Raw Ore: ") + rawErz + "/" + chargoMax + " | Quanta: " + rawQuanta + tr(" | Erz-Würfel: ", " | Ore Cubes: ") + (totalErzBuilt % 100) + "/100" + tr(" | FP-Würfel: ", " | RP Cubes: ") + (totalFPBuilt % 100) + "/100"; text(topStats, 16, hudTop + 10); drawWpnSlot(16, hudTop + 32, 1, "[1] Photon", getKindColor(a11yTheme, 4)); drawWpnSlot(136, hudTop + 32, 2, "[2] Gluon", getKindColor(a11yTheme, 5)); drawWpnSlot(256, hudTop + 32, 3, "[3] W-Boson", getKindColor(a11yTheme, 6)); drawWpnSlot(376, hudTop + 32, 4, tr("[4] Elektron", "[4] Electron"), getKindColor(a11yTheme, 3)); drawWpnSlot(496, hudTop + 32, 5, tr("[5] Mesonen", "[5] Mesons"), getKindColor(a11yTheme, 9)); drawNavBtn(624, hudTop + 32, 145, 26, zeroClick ? tr("0-Klick [0]: AN", "0-Click [0]: ON") : tr("0-Klick [0]: AUS", "0-Click [0]: OFF"), zeroClick ? color(20, 125, 75) : color(35, 45, 65)); drawNavBtn(777, hudTop + 32, 185, 26, tr("3D-Basis ansehen [B]", "View 3D Base [B]"), getUiPalette(a11yTheme, 2)); fill(8, 10, 18); stroke(55, 68, 95); rect(16, hudTop + 64, 946, 56, 5); fill(getKindColor(a11yTheme, 4)); textAlign(LEFT, TOP); text("SENSOR: " + sensorInfo, 26, hudTop + 70); fill(255); textSize(12); text(bannerHead, 26, hudTop + 88); fill(200, 215, 240); textSize(11); text(bannerSub, 26, hudTop + 105); // Minimap rechts unten int mapSize = 110; int mapX = width - mapSize - 16; int mapY = hudTop + 10; fill(4, 6, 12); stroke(getUiPalette(a11yTheme, 4)); rect(mapX, mapY, mapSize, mapSize, 4); fill(225, 55, 85); noStroke(); rect(map(baseAlphaX, -HALF_WORLD, HALF_WORLD, mapX + 6, mapX + mapSize - 6) - 4, map(baseAlphaY, -HALF_WORLD, HALF_WORLD, mapY + 6, mapY + mapSize - 6) - 4, 8, 8); fill(56, 189, 248); rect(map(baseBetaX, -HALF_WORLD, HALF_WORLD, mapX + 6, mapX + mapSize - 6) - 4, map(baseBetaY, -HALF_WORLD, HALF_WORLD, mapY + 6, mapY + mapSize - 6) - 4, 8, 8); fill(140, 185, 245); for (int i = 0; i < spaceAtoms.size(); i++) { MultiShellAtom a = (MultiShellAtom) spaceAtoms.get(i); rect(map(a.x, -HALF_WORLD, HALF_WORLD, mapX + 3, mapX + mapSize - 3), map(a.y, -HALF_WORLD, HALF_WORLD, mapY + 3, mapY + mapSize - 3), 2, 2); } fill(255); ellipse(map(shipX, -HALF_WORLD, HALF_WORLD, mapX + 4, mapX + mapSize - 4), map(shipY, -HALF_WORLD, HALF_WORLD, mapY + 4, mapY + mapSize - 4), 5, 5); } void drawWpnSlot(int bx, int by, int id, String lbl, int c) { boolean sel = (activeWeapon == id); fill(sel ? getUiPalette(a11yTheme, 2) : color(20, 25, 38)); stroke(sel ? getUiPalette(a11yTheme, 4) : color(60, 75, 105)); rect(bx, by, 114, 26, 4); fill(c); noStroke(); ellipse(bx + 12, by + 13, 9, 9); fill(255); textSize(11); textAlign(LEFT, CENTER); text(lbl, bx + 22, by + 13); } // ============================================================================================== // MODE 1: NORN TECH-TREE [T] // ============================================================================================== void drawTechTreeMode() { fill(getUiPalette(a11yTheme, 1)); stroke(59, 110, 194); rect(16, 48, width - 32, 676, 8); fill(255); textSize(16); textAlign(LEFT, TOP); text(tr("NORN-FORSCHUNGSBAUM — VERFÜGBARE FP: " + researchFP + " | GUTHABEN: " + creditsEUR + " EUR", "NORN RESEARCH TREE — AVAILABLE RP: " + researchFP + " | BALANCE: " + creditsEUR + " EUR"), 32, 62); drawNavBtn(width - 420, 58, 195, 28, freeTechMode ? tr("Modus: Freies Klicken [M]", "Mode: Free Click [M]") : tr("Modus: FP-Kosten [M]", "Mode: RP Cost [M]"), freeTechMode ? color(20, 125, 75) : getUiPalette(a11yTheme, 2)); drawNavBtn(width - 215, 58, 185, 28, tr("30 EUR -> +25 FP tauschen", "Exchange 30 EUR -> +25 RP"), getUiPalette(a11yTheme, 3)); for (int i = 0; i < NUM_TECH; i++) { int br = tBranchId[i]; int trIdx = tTier[i]; float nx = 32 + br * 268; float ny = 108 + trIdx * 195; float nw = 252; float nh = 176; boolean unlocked = freeTechMode || (tPrereq[i] < 0) || (tLevel[tPrereq[i]] > 0); int lvl = tLevel[i]; fill(lvl > 0 ? color(20, 32, 54) : color(15, 19, 30)); stroke(lvl > 0 ? getUiPalette(a11yTheme, 4) : color(55, 68, 95)); rect(nx, ny, nw, nh, 6); fill(255); textSize(12); textAlign(LEFT, TOP); text(tCode[i] + " · " + tr(tBranchDe[i], tBranchEn[i]), nx + 10, ny + 8); textAlign(RIGHT, TOP); text(tr("Stufe ", "Level ") + lvl + "/3", nx + nw - 10, ny + 8); textAlign(LEFT, TOP); textSize(13); text(tr(tTitleDe[i], tTitleEn[i]), nx + 10, ny + 30, nw - 20, 36); fill(210, 225, 245); textSize(11); text(tr(tDescDe[i], tDescEn[i]), nx + 10, ny + 68, nw - 20, 62); int cost = tCost[i] * (lvl + 1); if (lvl >= 3) { drawNavBtn(int(nx + 10), int(ny + 136), int(nw - 20), 28, tr("MAXIMAL AUSGEBAUT (3/3)", "MAXED OUT (3/3)"), color(20, 115, 70)); } else if (!unlocked) { drawNavBtn(int(nx + 10), int(ny + 136), int(nw - 20), 28, tr("Benötigt ", "Requires ") + tCode[tPrereq[i]], color(40, 48, 68)); } else { String lbl = freeTechMode ? tr("Ausbauen -> St. ", "Upgrade -> Lvl ") + (lvl + 1) : tr("Forschen (", "Research (") + cost + " FP)"; int bg = (freeTechMode || researchFP >= cost) ? getUiPalette(a11yTheme, 2) : color(45, 52, 72); drawNavBtn(int(nx + 10), int(ny + 136), int(nw - 20), 28, lbl, bg); } } } // ============================================================================================== // MODE 2: 3D-BASIS ISOMETRIE-ANSICHT [B] // ============================================================================================== void drawIsometricBaseMode() { fill(getUiPalette(a11yTheme, 1)); stroke(59, 110, 194); rect(16, 48, width - 32, 676, 8); fill(255); textSize(16); textAlign(LEFT, TOP); text(tr("3D-RAUMBASIS ISOMETRIE — ERZ-WÜRFEL: " + erzCubesCount + " | FORSCHUNGS-WÜRFEL: " + fpCubesCount, "3D SPACE BASE ISOMETRIC — ORE CUBES: " + erzCubesCount + " | RESEARCH CUBES: " + fpCubesCount), 32, 62); fill(215, 228, 248); textSize(12); text(tr("Jede 100 verarbeiteten Erz = 1 Blutrot/Titan-Würfel · Jede 100 FP = 1 Blau/Gold-Kristallwürfel", "Every 100 refined Ore = 1 Crimson/Titan Cube · Every 100 RP = 1 Blue/Gold Crystal Cube"), 32, 86); drawNavBtn(width - 490, 58, 135, 30, tr("Drehen [Q/E]", "Rotate [Q/E]"), getUiPalette(a11yTheme, 3)); drawNavBtn(width - 347, 58, 155, 30, tr("+100 Erz (Test-Würfel)", "+100 Ore (Test Cube)"), getUiPalette(a11yTheme, 2)); drawNavBtn(width - 184, 58, 155, 30, tr("+100 FP (Test-Würfel)", "+100 RP (Test Cube)"), getUiPalette(a11yTheme, 3)); float originX = width * 0.5; float originY = 230.0; float hw = 22.0; float hh = 11.0; float ch = 22.0; stroke(55, 72, 105); for (int i = 0; i <= BASE_DIM; i++) { line(originX + (0 - i) * hw, originY + (0 + i) * hh, originX + (BASE_DIM - i) * hw, originY + (BASE_DIM + i) * hh); line(originX + (i - 0) * hw, originY + (i + 0) * hh, originX + (i - BASE_DIM) * hw, originY + (i + BASE_DIM) * hh); } for (int z = 0; z < BASE_HEIGHT; z++) { for (int py = 0; py < BASE_DIM; py++) { for (int px = 0; px < BASE_DIM; px++) { int vx = px; int vy = py; if (isoRotation == 1) { vx = py; vy = BASE_DIM - 1 - px; } else if (isoRotation == 2) { vx = BASE_DIM - 1 - px; vy = BASE_DIM - 1 - py; } else if (isoRotation == 3) { vx = BASE_DIM - 1 - py; vy = px; } int vType = getBaseVoxel(vx, vy, z); if (vType > 0) { float sx = originX + (px - py) * hw; float sy = originY + (px + py) * hh - z * ch; int c = (vType == 1) ? color(210, 42, 74) : color(65, 155, 255); if (a11yTheme == 1) c = (vType == 1) ? color(251, 191, 36) : color(56, 189, 248); if (a11yTheme == 2) c = (vType == 1) ? color(255, 255, 0) : color(0, 255, 255); drawIsoCubeSolid(sx, sy, hw, hh, ch, c); } } } } drawNavBtn(int(width * 0.5 - 170), height - 66, 340, 36, tr("BASIS JETZT IN 3D BEGEHEN (OHNE P3D) [V] >>", "WALK INSIDE 3D BASE NOW (NO P3D) [V] >>"), getUiPalette(a11yTheme, 2)); } void drawIsoCubeSolid(float sx, float sy, float hw, float hh, float ch, int c) { stroke(12, 16, 26); fill(c); beginShape(); vertex(sx, sy); vertex(sx + hw, sy + hh); vertex(sx, sy + 2 * hh); vertex(sx - hw, sy + hh); endShape(CLOSE); fill(red(c) * 0.75, green(c) * 0.75, blue(c) * 0.75); beginShape(); vertex(sx - hw, sy + hh); vertex(sx, sy + 2 * hh); vertex(sx, sy + 2 * hh + ch); vertex(sx - hw, sy + hh + ch); endShape(CLOSE); fill(red(c) * 0.52, green(c) * 0.52, blue(c) * 0.52); beginShape(); vertex(sx, sy + 2 * hh); vertex(sx + hw, sy + hh); vertex(sx + hw, sy + hh + ch); vertex(sx, sy + 2 * hh + ch); endShape(CLOSE); } // ============================================================================================== // MODE 3: 3D-BASIS BEGEHUNG — PURE SOFTWARE DDA-RAYCASTER (OHNE P3D!) // ============================================================================================== void enterWalk3DBaseMode() { viewMode = 3; walkX = 7.5; walkY = 7.5; walkDirX = 1.0; walkDirY = 0.0; walkPlaneX = 0.0; walkPlaneY = 0.66; } void drawWalk3DBaseMode() { int startX = 340; int viewW = width - startX; int viewH = height - 38; int topY = 38; float spd = 0.065; if (keyTurnL) rotateWalkCam(-0.045); if (keyTurnR) rotateWalkCam(0.045); if (keyW) { if (!isWalkWall(int(walkX + walkDirX * spd), int(walkY))) walkX += walkDirX * spd; if (!isWalkWall(int(walkX), int(walkY + walkDirY * spd))) walkY += walkDirY * spd; } if (keyS) { if (!isWalkWall(int(walkX - walkDirX * spd), int(walkY))) walkX -= walkDirX * spd; if (!isWalkWall(int(walkX), int(walkY - walkDirY * spd))) walkY -= walkDirY * spd; } if (keyA) { float sx = walkDirY; float sy = -walkDirX; if (!isWalkWall(int(walkX + sx * spd), int(walkY))) walkX += sx * spd; if (!isWalkWall(int(walkX), int(walkY + sy * spd))) walkY += sy * spd; } if (keyD) { float sx = -walkDirY; float sy = walkDirX; if (!isWalkWall(int(walkX + sx * spd), int(walkY))) walkX += sx * spd; if (!isWalkWall(int(walkX), int(walkY + sy * spd))) walkY += sy * spd; } noStroke(); fill(18, 6, 12); rect(startX, topY, viewW, viewH / 2); fill(10, 16, 30); rect(startX, topY + viewH / 2, viewW, viewH / 2); for (int x = 0; x < viewW; x++) { float camXNorm = 2.0 * x / float(viewW) - 1.0; float rdx = walkDirX + walkPlaneX * camXNorm; float rdy = walkDirY + walkPlaneY * camXNorm; int mapX = int(walkX); int mapY = int(walkY); float ddx = (rdx == 0.0) ? 1e30 : abs(1.0 / rdx); float ddy = (rdy == 0.0) ? 1e30 : abs(1.0 / rdy); int stepX = (rdx < 0) ? -1 : 1; int stepY = (rdy < 0) ? -1 : 1; float sdx = (rdx < 0) ? (walkX - mapX) * ddx : (mapX + 1.0 - walkX) * ddx; float sdy = (rdy < 0) ? (walkY - mapY) * ddy : (mapY + 1.0 - walkY) * ddy; int hit = 0; int side = 0; int wallType = 0; int guard = 0; while (hit == 0 && guard < 40) { guard++; if (sdx < sdy) { sdx += ddx; mapX += stepX; side = 0; } else { sdy += ddy; mapY += stepY; side = 1; } if (mapX <= 0 || mapX >= BASE_DIM - 1 || mapY <= 0 || mapY >= BASE_DIM - 1) { hit = 1; wallType = 3; } else { int v = getBaseVoxel(mapX, mapY, 0); if (v > 0) { hit = 1; wallType = v; } } } float distW = (side == 0) ? max(0.08, (mapX - walkX + (1 - stepX) * 0.5) / rdx) : max(0.08, (mapY - walkY + (1 - stepY) * 0.5) / rdy); int lh = int(viewH / distW); int y0 = max(0, -lh / 2 + viewH / 2); int y1 = min(viewH - 1, lh / 2 + viewH / 2); int col = color(110, 125, 150); if (wallType == 1) col = color(210, 42, 74); else if (wallType == 2) col = color(65, 155, 255); float shade = constrain(1.0 / (1.0 + distW * 0.16), 0.22, 1.0); if (side == 1) shade *= 0.72; stroke(red(col) * shade, green(col) * shade, blue(col) * shade); line(startX + x, topY + y0, startX + x, topY + y1); } fill(getUiPalette(a11yTheme, 1)); noStroke(); rect(0, topY, startX, viewH); stroke(getUiPalette(a11yTheme, 4)); line(startX, topY, startX, height); fill(255); textSize(15); textAlign(LEFT, TOP); text(tr("3D-BASIS BEGEHUNG (OHNE P3D)", "3D BASE WALKTHROUGH (NO P3D)"), 16, topY + 14); fill(215, 228, 248); textSize(12); text(tr("Rot = Erz-Würfel (" + erzCubesCount + ")\nBlau = Forschungs-Würfel (" + fpCubesCount + ")\n\nSteuerung:\n[W/A/S/D] Laufen\n[Maus ziehen / Pfeile] Drehen", "Red = Ore Cubes (" + erzCubesCount + ")\nBlue = Research Cubes (" + fpCubesCount + ")\n\nControls:\n[W/A/S/D] Move\n[Drag Mouse / Arrows] Turn"), 16, topY + 44); int cellPx = 18; int gx0 = 24; int gy0 = topY + 210; for (int y = 0; y < BASE_DIM; y++) { for (int x = 0; x < BASE_DIM; x++) { int v = getBaseVoxel(x, y, 0); if (x == 0 || y == 0 || x == BASE_DIM - 1 || y == BASE_DIM - 1) fill(70, 82, 110); else if (v == 1) fill(210, 42, 74); else if (v == 2) fill(65, 155, 255); else fill(16, 20, 32); noStroke(); rect(gx0 + x * cellPx, gy0 + y * cellPx, cellPx - 1, cellPx - 1); } } fill(255, 230, 60); ellipse(gx0 + walkX * cellPx, gy0 + walkY * cellPx, 7, 7); drawNavBtn(24, height - 62, 290, 38, tr("← ZURÜCK ZUM RAUMSCHIFF [1]", "← BACK TO STARSHIP [1]"), getUiPalette(a11yTheme, 2)); } boolean isWalkWall(int gx, int gy) { if (gx <= 0 || gx >= BASE_DIM - 1 || gy <= 0 || gy >= BASE_DIM - 1) return true; return (getBaseVoxel(gx, gy, 0) > 0); } void rotateWalkCam(float rot) { float oldDirX = walkDirX; walkDirX = walkDirX * cos(rot) - walkDirY * sin(rot); walkDirY = oldDirX * sin(rot) + walkDirY * cos(rot); float oldPlaneX = walkPlaneX; walkPlaneX = walkPlaneX * cos(rot) - walkPlaneY * sin(rot); walkPlaneY = oldPlaneX * sin(rot) + walkPlaneY * cos(rot); } // ============================================================================================== // ENTITÄTEN-KLASSEN & EINGABEN // ============================================================================================== class VacuumQuantum { float x, y; VacuumQuantum(float qx, float qy) { x = qx; y = qy; } } class SingularityRift { float x, y, phase; SingularityRift(float rx, float ry) { x = rx; y = ry; phase = random(TWO_PI); } } class BosonShot { float x, y, vx, vy; int kind, life; BosonShot(float sx, float sy, float svx, float svy, int k) { x = sx; y = sy; vx = svx; vy = svy; kind = k; life = 110; } } class ShockRing { float x, y, r; int col, alpha; ShockRing(float rx, float ry, int c) { x = rx; y = ry; r = 12.0; col = c; alpha = 235; } } void mouseMoved() { if (languageChosen && viewMode == 0 && mouseY > 38 && mouseY < height - 130) mouseSteer = true; } void mousePressed() { // 0. Sprachwahl-Startfenster if (!languageChosen) { int mx = 210; int my = 125; if (mouseY >= my + 345 && mouseY <= my + 409) { if (mouseX >= mx + 35 && mouseX <= mx + 330) { langMode = 0; languageChosen = true; setWelcomeBanner(); return; } if (mouseX >= mx + 370 && mouseX <= mx + 665) { langMode = 1; languageChosen = true; setWelcomeBanner(); return; } } if (mouseY >= my + 426 && mouseY <= my + 458) { a11yTheme = (a11yTheme + 1) % 3; } return; } // 1. Globale Top-Leiste (y: 0..38) if (mouseY <= 38) { if (mouseX >= 10 && mouseX <= 144) { viewMode = 0; return; } if (mouseX >= 150 && mouseX <= 278) { viewMode = 1; return; } if (mouseX >= 284 && mouseX <= 430) { viewMode = 2; return; } if (mouseX >= 436 && mouseX <= 572) { enterWalk3DBaseMode(); return; } if (mouseX >= width - 196 && mouseX <= width - 134) { langMode = (langMode + 1) % 2; setWelcomeBanner(); return; } if (mouseX >= width - 128 && mouseX <= width - 10) { a11yTheme = (a11yTheme + 1) % 3; return; } return; } // 2. Tech-Tree Klicks (Mode 1) if (viewMode == 1) { if (mouseX >= width - 420 && mouseX <= width - 225 && mouseY >= 58 && mouseY <= 86) { freeTechMode = !freeTechMode; return; } if (mouseX >= width - 215 && mouseX <= width - 30 && mouseY >= 58 && mouseY <= 86) { if (creditsEUR >= 30) { creditsEUR -= 30; addResearchFP(25); } return; } for (int i = 0; i < NUM_TECH; i++) { float nx = 32 + tBranchId[i] * 268; float ny = 108 + tTier[i] * 195; if (mouseX >= nx && mouseX <= nx + 252 && mouseY >= ny && mouseY <= ny + 176) { selectedTech = i; boolean unlocked = freeTechMode || (tPrereq[i] < 0) || (tLevel[tPrereq[i]] > 0); int cost = tCost[i] * (tLevel[i] + 1); if (unlocked && tLevel[i] < 3 && (freeTechMode || researchFP >= cost)) { if (!freeTechMode) researchFP -= cost; tLevel[i]++; recalcShipCapabilities(); if (i == 6) hullHP = min(maxHullHP, hullHP + 45); } return; } } return; } // 3. 3D-Isometrie Klicks (Mode 2) if (viewMode == 2) { if (mouseY >= 58 && mouseY <= 88) { if (mouseX >= width - 490 && mouseX <= width - 355) { isoRotation = (isoRotation + 1) % 4; return; } if (mouseX >= width - 347 && mouseX <= width - 192) { addRefinedErz(100); return; } if (mouseX >= width - 184 && mouseX <= width - 29) { addResearchFP(100); return; } } if (mouseY >= height - 66 && mouseY <= height - 30 && mouseX >= width * 0.5 - 170 && mouseX <= width * 0.5 + 170) { enterWalk3DBaseMode(); return; } return; } // 4. 3D-Begehung Zurück-Button (Mode 3) if (viewMode == 3) { if (mouseX >= 24 && mouseX <= 314 && mouseY >= height - 62 && mouseY <= height - 24) { viewMode = 0; } return; } // 5. Mikrokosmos-Flug HUD & Schuss (Mode 0) int hudTop = height - 130; if (mouseY >= hudTop) { if (mouseY >= hudTop + 32 && mouseY <= hudTop + 58) { if (mouseX >= 16 && mouseX <= 130) { activeWeapon = 1; return; } if (mouseX >= 136 && mouseX <= 250) { activeWeapon = 2; return; } if (mouseX >= 256 && mouseX <= 370) { activeWeapon = 3; return; } if (mouseX >= 376 && mouseX <= 490) { activeWeapon = 4; return; } if (mouseX >= 496 && mouseX <= 610) { activeWeapon = 5; return; } if (mouseX >= 624 && mouseX <= 769) { zeroClick = !zeroClick; return; } if (mouseX >= 777 && mouseX <= 962) { viewMode = 2; return; } } return; } if (mouseY > 38 && mouseY < hudTop && mouseButton == LEFT) { fireActiveWeapon(); } } void mouseDragged() { if (languageChosen && viewMode == 3 && mouseX > 340) { rotateWalkCam(-(mouseX - pmouseX) * 0.012); } } void keyPressed() { if (!languageChosen) { if (key == '1' || key == 'd' || key == 'D') { langMode = 0; languageChosen = true; setWelcomeBanner(); } if (key == '2' || key == 'e' || key == 'E') { langMode = 1; languageChosen = true; setWelcomeBanner(); } if (key == 'h' || key == 'H') a11yTheme = (a11yTheme + 1) % 3; return; } if (key == '1') { if (viewMode != 0) viewMode = 0; else activeWeapon = 1; } if (key == '2') activeWeapon = 2; if (key == '3') activeWeapon = 3; if (key == '4') activeWeapon = 4; if (key == '5') activeWeapon = 5; if (key == '0') zeroClick = !zeroClick; if (key == 't' || key == 'T') viewMode = (viewMode == 1) ? 0 : 1; if (key == 'b' || key == 'B') viewMode = (viewMode == 2) ? 0 : 2; if (key == 'v' || key == 'V') { if (viewMode == 3) viewMode = 0; else enterWalk3DBaseMode(); } if (key == 'm' || key == 'M') freeTechMode = !freeTechMode; if (key == 'q' || key == 'Q') isoRotation = (isoRotation + 3) % 4; if (key == 'e' || key == 'E') isoRotation = (isoRotation + 1) % 4; if (key == 'l' || key == 'L') { langMode = (langMode + 1) % 2; setWelcomeBanner(); } if (key == 'h' || key == 'H') a11yTheme = (a11yTheme + 1) % 3; if (key == ' ' && viewMode == 0) fireActiveWeapon(); if (key == 'w' || key == 'W') keyW = true; if (key == 's' || key == 'S') keyS = true; if (key == 'a' || key == 'A') keyA = true; if (key == 'd' || key == 'D') keyD = true; if (key == CODED) { if (keyCode == UP) keyW = true; if (keyCode == DOWN) keyS = true; if (keyCode == LEFT) keyTurnL = true; if (keyCode == RIGHT) keyTurnR = true; } } void keyReleased() { if (key == 'w' || key == 'W') keyW = false; if (key == 's' || key == 'S') keyS = false; if (key == 'a' || key == 'A') keyA = false; if (key == 'd' || key == 'D') keyD = false; if (key == CODED) { if (keyCode == UP) keyW = false; if (keyCode == DOWN) keyS = false; if (keyCode == LEFT) keyTurnL = false; if (keyCode == RIGHT) keyTurnR = false; } }