add offline mode for solo play with local game state simulation
All checks were successful
Dynamic Branch Deploy / build-and-deploy (push) Successful in 1m47s
All checks were successful
Dynamic Branch Deploy / build-and-deploy (push) Successful in 1m47s
This commit is contained in:
@@ -185,9 +185,14 @@ func (g *Game) UpdateGame() {
|
||||
}
|
||||
|
||||
// --- 5. INPUT SENDEN (MIT CLIENT PREDICTION, 20 TPS) ---
|
||||
if g.connected && time.Since(g.lastInputTime) >= physicsStep {
|
||||
if (g.connected || g.isOffline) && time.Since(g.lastInputTime) >= physicsStep {
|
||||
g.lastInputTime = time.Now()
|
||||
|
||||
// Offline: Update Scroll & World logic locally
|
||||
if g.isOffline {
|
||||
g.updateOfflineLoop()
|
||||
}
|
||||
|
||||
g.predictionMutex.Lock()
|
||||
wasOnGround := g.predictedGround
|
||||
g.predictionMutex.Unlock()
|
||||
|
||||
Reference in New Issue
Block a user