Integrate shared physics engine for player movement and collision handling, refine 20 TPS gameplay logic, and enhance client prediction with server-reconciliation updates.
All checks were successful
Dynamic Branch Deploy / build-and-deploy (push) Successful in 7m51s
All checks were successful
Dynamic Branch Deploy / build-and-deploy (push) Successful in 7m51s
This commit is contained in:
@@ -159,7 +159,20 @@ func main() {
|
||||
rooms[roomID] = room
|
||||
|
||||
// Starte den Game-Loop (Physik)
|
||||
go room.RunLoop()
|
||||
go func() {
|
||||
room.RunLoop()
|
||||
// Nach Ende des Spiels: Raum aufräumen
|
||||
mu.Lock()
|
||||
delete(rooms, roomID)
|
||||
// Entferne auch alle Spieler-Sessions aus diesem Raum
|
||||
for playerID, r := range playerSessions {
|
||||
if r == room {
|
||||
delete(playerSessions, playerID)
|
||||
}
|
||||
}
|
||||
mu.Unlock()
|
||||
log.Printf("🧹 Raum '%s' wurde aufgeräumt nach GAMEOVER", roomID)
|
||||
}()
|
||||
}
|
||||
|
||||
// Spieler hinzufügen (ID, Name)
|
||||
|
||||
Reference in New Issue
Block a user