add music, better sync, particles
All checks were successful
Dynamic Branch Deploy / build-and-deploy (push) Successful in 2m18s
All checks were successful
Dynamic Branch Deploy / build-and-deploy (push) Successful in 2m18s
This commit is contained in:
43
types.go
43
types.go
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user