fix game
All checks were successful
Dynamic Branch Deploy / build-and-deploy (push) Successful in 7m29s
All checks were successful
Dynamic Branch Deploy / build-and-deploy (push) Successful in 7m29s
This commit is contained in:
@@ -100,6 +100,17 @@ type Game struct {
|
||||
lastRecvSeq uint32 // Letzte empfangene Server-Sequenznummer (für Out-of-Order-Erkennung)
|
||||
lastInputTime time.Time // Letzter Input-Send (für 20 TPS Throttling)
|
||||
|
||||
// Interpolation (60fps Draw ↔ 20hz Physics)
|
||||
prevPredictedX float64 // Position vor letztem Physics-Step (für Interpolation)
|
||||
prevPredictedY float64
|
||||
lastPhysicsTime time.Time // Zeitpunkt des letzten Physics-Steps
|
||||
|
||||
// Jump Buffer: Sprung kurz vor Landung speichern → löst beim Aufkommen aus
|
||||
jumpBufferFrames int // Countdown in Physics-Frames (bei 0: kein Buffer)
|
||||
|
||||
// Coyote Time: Sprung kurz nach Abgang von Kante erlauben
|
||||
coyoteFrames int // Countdown in Physics-Frames
|
||||
|
||||
// Smooth Correction (Debug-Info)
|
||||
correctionX float64 // Letzte Korrektur-Magnitude X
|
||||
correctionY float64 // Letzte Korrektur-Magnitude Y
|
||||
@@ -176,6 +187,9 @@ func NewGame() *Game {
|
||||
fpsSampleTime: time.Now(),
|
||||
lastUpdateTime: time.Now(),
|
||||
|
||||
// Interpolation
|
||||
lastPhysicsTime: time.Now(),
|
||||
|
||||
joyBaseX: 150, joyBaseY: ScreenHeight - 150,
|
||||
joyStickX: 150, joyStickY: ScreenHeight - 150,
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user