"use client"; import { useGameEngine } from "@/hooks/useGameEngine"; import HUD from "../components/Hud"; import GalaxyMap from "../components/GalaxyMap"; import EventLog from "../components/EventLog"; import ActionPanel from "../components/ActionPanel"; import StartScreen from "@/components/StartScreen"; import GameOverScreen from "@/components/GameOverScreen"; import { t } from "@/content/locales"; // Import der Locales export default function Home() { const { gameStarted, startGame, planets, credits, hp, loading, currentLocationId, selectedPlanet, setSelectedPlanet, handleAttack, executeJump, isJumping, activeEnemy, executeEscape, logs, isGameOver, restartGame, } = useGameEngine(); // 1. Ladezustand if (loading) { return (
{t.SYSTEM.LOADING}
); } // Aktuellen Planeten finden für das HUD const currentPlanet = planets.find((p) => p.id === currentLocationId); // 2. Startbildschirm if (!gameStarted) { return ; } return (
setSelectedPlanet(p)} currentLocationId={currentLocationId} /> {/* ActionPanel erscheint bei Zielwahl oder Feindkontakt */} {(selectedPlanet || activeEnemy) && ( )}
{/* Game Over Overlay */} {isGameOver && ( )}
); }