'use client' import { useGameStore } from '@/stores/gameStore' import { usePlayerStore } from '@/stores/playerStore' import { useWorldStore } from '@/stores/worldStore' export function DebugOverlay() { const { debug, fps, tps } = useGameStore() const { player } = usePlayerStore() const { world } = useWorldStore() if (!debug || !player) return null const [x, y, z] = player.position const [yaw, pitch] = player.rotation const timeOfDay = world ? (world.time / 24000 * 24).toFixed(1) : '0' const chunkX = Math.floor(x / 16) const chunkZ = Math.floor(z / 16) const biome = 'Plains' // TODO return (
Minecraft Clone Debug (F3)
FPS: {fps} | TPS: {tps}
XYZ: {x.toFixed(1)} / {y.toFixed(1)} / {z.toFixed(1)}
Chunk: [{chunkX}, {chunkZ}]
Yaw: {(yaw * 180 / Math.PI).toFixed(1)}° Pitch: {(pitch * 180 / Math.PI).toFixed(1)}°
Time: {timeOfDay}h | Mode: {player.gamemode}
Flying: {player.flying ? 'Yes' : 'No'} On Ground: {player.onGround ? 'Yes' : 'No'}
Health: {player.health} | Food: {player.foodLevel}
) }