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:
20
pkg/protocol/messages.go
Normal file
20
pkg/protocol/messages.go
Normal 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"`
|
||||
}
|
||||
Reference in New Issue
Block a user