21 lines
531 B
Go
21 lines
531 B
Go
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"`
|
|
}
|