Private
Public Access
1
0

fix game
All checks were successful
Dynamic Branch Deploy / build-and-deploy (push) Successful in 7m3s

This commit is contained in:
Sebastian Unterschütz
2026-03-22 10:44:58 +01:00
parent 1dc5005cf3
commit aff505773a
12 changed files with 693 additions and 16 deletions

View File

@@ -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
}