Private
Public Access
1
0

Add platform-specific implementations for assets, audio, WebSocket, and rendering on Desktop and WebAssembly platforms. Introduce embedded assets for WebAssembly and native file handling for Desktop. Add platform-specific chunk loading and game state synchronization.

This commit is contained in:
Sebastian Unterschütz
2026-01-04 01:25:04 +01:00
parent 85d697df19
commit 3232ee7c2f
86 changed files with 4931 additions and 486 deletions

View File

@@ -0,0 +1,25 @@
//go:build !wasm
// +build !wasm
package main
import (
"log"
"path/filepath"
)
// loadChunks lädt alle Chunks aus dem Verzeichnis (Native Desktop)
func (g *Game) loadChunks() {
baseDir := "cmd/client/assets"
chunkDir := filepath.Join(baseDir, "chunks")
err := g.world.LoadChunkLibrary(chunkDir)
if err != nil {
log.Println("⚠️ Chunks konnten nicht geladen werden:", err)
} else {
log.Printf("✅ Chunks geladen: %d Einträge", len(g.world.ChunkLibrary))
for id, chunk := range g.world.ChunkLibrary {
log.Printf(" 📦 Chunk '%s': Width=%d, Objects=%d", id, chunk.Width, len(chunk.Objects))
}
}
}