Private
Public Access
Add WebAssembly support for assets and chunks, implement gameover screen rendering, and enhance server gameplay logic with dynamic speeds, team naming, and score components.
This commit is contained in:
1 parent
ce51a2ba4f
commit
95d61bf66e
68 files changed
+913
-424
No files matched your search
+16
-5
@@ -66,10 +66,11 @@ type LoginPayload struct {
|
||||
|
||||
// Input vom Spieler während des Spiels
|
||||
type ClientInput struct {
|
||||
Type string `json:"type"` // "JUMP", "START", "LEFT_DOWN", "RIGHT_DOWN", etc.
|
||||
Type string `json:"type"` // "JUMP", "START", "LEFT_DOWN", "RIGHT_DOWN", "SET_TEAM_NAME", etc.
|
||||
RoomID string `json:"room_id"`
|
||||
PlayerID string `json:"player_id"`
|
||||
Sequence uint32 `json:"sequence"` // Sequenznummer für Client Prediction
|
||||
Sequence uint32 `json:"sequence"` // Sequenznummer für Client Prediction
|
||||
TeamName string `json:"team_name,omitempty"` // Für SET_TEAM_NAME Input
|
||||
}
|
||||
|
||||
type JoinRequest struct {
|
||||
@@ -105,6 +106,7 @@ type GameState struct {
|
||||
TimeLeft int `json:"time_left"`
|
||||
WorldChunks []ActiveChunk `json:"world_chunks"`
|
||||
HostID string `json:"host_id"`
|
||||
TeamName string `json:"team_name"` // Team-Name (vom Host gesetzt)
|
||||
ScrollX float64 `json:"scroll_x"`
|
||||
CollectedCoins map[string]bool `json:"collected_coins"` // Welche Coins wurden eingesammelt (Key: ChunkID_ObjectIndex)
|
||||
CollectedPowerups map[string]bool `json:"collected_powerups"` // Welche Powerups wurden eingesammelt
|
||||
@@ -125,7 +127,8 @@ type LeaderboardEntry struct {
|
||||
PlayerName string `json:"player_name"`
|
||||
PlayerCode string `json:"player_code"` // Eindeutiger Code für Verifikation
|
||||
Score int `json:"score"`
|
||||
Timestamp int64 `json:"timestamp"` // Unix-Timestamp
|
||||
Timestamp int64 `json:"timestamp"` // Unix-Timestamp
|
||||
ProofCode string `json:"proof_code"` // Beweis-Code zum Verifizieren des Scores
|
||||
}
|
||||
|
||||
// Score-Submission vom Client an Server
|
||||
@@ -133,8 +136,16 @@ type ScoreSubmission struct {
|
||||
PlayerName string `json:"player_name"`
|
||||
PlayerCode string `json:"player_code"`
|
||||
Score int `json:"score"`
|
||||
Name string `json:"name"` // Alternativer Name-Feld (für Kompatibilität)
|
||||
Mode string `json:"mode"` // "solo" oder "coop"
|
||||
Name string `json:"name"` // Alternativer Name-Feld (für Kompatibilität)
|
||||
Mode string `json:"mode"` // "solo" oder "coop"
|
||||
TeamName string `json:"team_name"` // Team-Name für Coop-Mode
|
||||
}
|
||||
|
||||
// Score-Submission Response vom Server an Client
|
||||
type ScoreSubmissionResponse struct {
|
||||
Success bool `json:"success"`
|
||||
ProofCode string `json:"proof_code"`
|
||||
Score int `json:"score"`
|
||||
}
|
||||
|
||||
// Start-Request vom Client
|
||||
|
||||
+1
-1
@@ -83,7 +83,7 @@ func (w *World) GenerateColliders(activeChunks []ActiveChunk) []Collider {
|
||||
continue
|
||||
}
|
||||
|
||||
if def.Type == "obstacle" || def.Type == "platform" {
|
||||
if def.Type == "obstacle" || def.Type == "platform" || def.Type == "wall" {
|
||||
c := Collider{
|
||||
Rect: Rect{
|
||||
OffsetX: ac.X + obj.X + def.DrawOffX + def.Hitbox.OffsetX,
|
||||
|
||||
Reference in new issue
Block a user