Private
Public Access
1
0

enhance offline mode: add moving platforms, collision detection, and power-ups
All checks were successful
Dynamic Branch Deploy / build-and-deploy (push) Successful in 1m58s

This commit is contained in:
Sebastian Unterschütz
2026-04-22 18:35:58 +02:00
parent fcf44ba513
commit 9742ccb038
2 changed files with 254 additions and 13 deletions

View File

@@ -55,6 +55,27 @@ type InputState struct {
JoyX float64 // Analoger Joystick-Wert (-1.0 bis 1.0)
}
type MovingPlatform struct {
ChunkID string
ObjectIdx int
AssetID string
CurrentX float64
CurrentY float64
StartX float64
StartY float64
EndX float64
EndY float64
Speed float64
Direction float64
IsActive bool
HitboxW float64
HitboxH float64
DrawOffX float64
DrawOffY float64
HitboxOffX float64
HitboxOffY float64
}
// --- GAME STRUCT ---
type Game struct {
appState int
@@ -74,6 +95,10 @@ type Game struct {
activeField string // "name" oder "room" oder "teamname"
gameMode string // "solo" oder "coop"
isOffline bool // Läuft das Spiel lokal ohne Server?
offlineMovingPlatforms []*MovingPlatform // Lokale bewegende Plattformen für Offline-Modus
godModeEndTime time.Time
magnetEndTime time.Time
doubleJumpEndTime time.Time
isHost bool
teamName string // Team-Name für Coop beim Game Over
@@ -876,6 +901,9 @@ func (g *Game) resetForNewGame() {
// Spieler-State zurücksetzen
g.isOffline = false
g.godModeEndTime = time.Time{}
g.magnetEndTime = time.Time{}
g.doubleJumpEndTime = time.Time{}
g.scoreSubmitted = false
g.lastStatus = ""
g.correctionCount = 0