Private
Public Access
1
0

add music, better sync, particles
All checks were successful
Dynamic Branch Deploy / build-and-deploy (push) Successful in 2m18s

This commit is contained in:
Sebastian Unterschütz
2025-11-29 23:37:57 +01:00
parent 5ce097bbb7
commit 669c783a06
43 changed files with 3001 additions and 878 deletions

View File

@@ -10,14 +10,46 @@ type ObstacleDef struct {
CanTalk bool `json:"canTalk"`
SpeechLines []string `json:"speechLines"`
YOffset float64 `json:"yOffset"`
ImgScale float64 `json:"imgScale"`
ImgOffsetX float64 `json:"imgOffsetX"`
ImgOffsetY float64 `json:"imgOffsetY"`
}
type ChunkObstacle struct {
ID string `json:"id"`
Type string `json:"type"`
X float64 `json:"x"`
Y float64 `json:"y"`
Width float64 `json:"w"`
Height float64 `json:"h"`
Color string `json:"color"`
ImgScale float64 `json:"imgScale"`
ImgOffsetX float64 `json:"imgOffsetX"`
ImgOffsetY float64 `json:"imgOffsetY"`
}
type PlatformDef struct {
X float64 `json:"x"`
Y float64 `json:"y"`
Width float64 `json:"w"`
Height float64 `json:"h"`
Type string `json:"type"`
}
type ChunkDef struct {
ID string `json:"id"`
Platforms []PlatformDef `json:"platforms"`
Obstacles []ChunkObstacle `json:"obstacles"`
TotalWidth int `json:"totalWidth"`
}
type GameConfig struct {
Obstacles []ObstacleDef `json:"obstacles"`
Backgrounds []string `json:"backgrounds"`
Chunks []ChunkDef `json:"chunks"`
}
// Dynamischer State
// Dynamischer State (Simulation)
type ActiveObstacle struct {
ID string `json:"id"`
Type string `json:"type"`
@@ -27,6 +59,13 @@ type ActiveObstacle struct {
Height float64 `json:"h"`
}
type ActivePlatform struct {
X float64 `json:"x"`
Y float64 `json:"y"`
Width float64 `json:"w"`
Height float64 `json:"h"`
}
// API Requests/Responses
type Input struct {
Tick int `json:"t"`
@@ -49,9 +88,11 @@ type ValidateResponse struct {
Status string `json:"status"`
VerifiedScore int `json:"verifiedScore"`
ServerObs []ActiveObstacle `json:"serverObs"`
ServerPlats []ActivePlatform `json:"serverPlats"`
PowerUps PowerUpState `json:"powerups"`
ServerTick int `json:"serverTick"`
NextSpawnTick int `json:"nextSpawnTick"`
RngState uint32 `json:"rngState"`
}
type StartResponse struct {