fix game
All checks were successful
Dynamic Branch Deploy / build-and-deploy (push) Successful in 7m3s
All checks were successful
Dynamic Branch Deploy / build-and-deploy (push) Successful in 7m3s
This commit is contained in:
@@ -56,11 +56,23 @@ func ApplyPhysics(
|
||||
state *PlayerPhysicsState,
|
||||
input PhysicsInput,
|
||||
currentSpeed float64,
|
||||
difficultyFactor float64,
|
||||
collisionChecker CollisionChecker,
|
||||
playerConst PlayerConstants,
|
||||
) {
|
||||
// Schwierigkeits-skalierte Parameter
|
||||
// Air Control sinkt von AirControlFactor (0.4) auf AirControlMin (0.15)
|
||||
effectiveAirControl := config.AirControlFactor - (config.AirControlFactor-config.AirControlMin)*difficultyFactor
|
||||
// Gravitation steigt von Gravity (1.5) auf GravityMax (2.8)
|
||||
effectiveGravity := config.Gravity + (config.GravityMax-config.Gravity)*difficultyFactor
|
||||
|
||||
// --- HORIZONTALE BEWEGUNG MIT KOLLISION ---
|
||||
playerMovement := input.InputX * config.PlayerSpeed
|
||||
// In der Luft: reduzierte Horizontalkontrolle (skaliert mit Schwierigkeit)
|
||||
airControl := 1.0
|
||||
if !state.OnGround && !state.OnWall {
|
||||
airControl = effectiveAirControl
|
||||
}
|
||||
playerMovement := input.InputX * config.PlayerSpeed * airControl
|
||||
speed := currentSpeed + playerMovement
|
||||
nextX := state.X + speed
|
||||
|
||||
@@ -96,8 +108,8 @@ func ApplyPhysics(
|
||||
state.VY = -config.WallClimbSpeed
|
||||
}
|
||||
} else {
|
||||
// Normal: Volle Gravität
|
||||
state.VY += config.Gravity
|
||||
// Normal: Schwierigkeit-skalierte Gravität
|
||||
state.VY += effectiveGravity
|
||||
if state.VY > config.MaxFall {
|
||||
state.VY = config.MaxFall
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user