Private
Public Access
1
0

Introduce core components for "Escape From Teacher" game: server, client, physics, asset system, and protocol definitions. Add Docker-Compose setup for Redis and NATS infrastructure.

This commit is contained in:
Sebastian Unterschütz
2026-01-01 15:21:18 +01:00
commit 3099ac42c0
9 changed files with 1384 additions and 0 deletions

20
pkg/protocol/messages.go Normal file
View File

@@ -0,0 +1,20 @@
package protocol
// Input: Was der Spieler drückt
type InputMessage struct {
PlayerID string `json:"id"`
Jump bool `json:"jump"`
}
// State: Wo alles ist (Server -> Client)
type GameStateMessage struct {
Players map[string]*PlayerState `json:"players"` // Alle Spieler (1 bis 16)
Score float64 `json:"score"`
Multiplier int `json:"multiplier"`
}
type PlayerState struct {
// WICHTIG: Jedes Feld braucht ein eigenes JSON-Tag!
X float64 `json:"x"`
Y float64 `json:"y"`
}