update workflows and game logic: add CERT_ISSUER support, enhance offline mode with countdown, and adjust default audio settings
All checks were successful
Dynamic Branch Deploy / build-and-deploy (push) Successful in 1m50s
All checks were successful
Dynamic Branch Deploy / build-and-deploy (push) Successful in 1m50s
This commit is contained in:
@@ -12,6 +12,14 @@ import (
|
||||
// ApplyInput wendet einen Input auf den vorhergesagten Zustand an
|
||||
// Nutzt die gemeinsame Physik-Engine aus pkg/physics
|
||||
func (g *Game) ApplyInput(input InputState) {
|
||||
g.stateMutex.Lock()
|
||||
status := g.gameState.Status
|
||||
g.stateMutex.Unlock()
|
||||
|
||||
if status == "COUNTDOWN" {
|
||||
return
|
||||
}
|
||||
|
||||
// Horizontale Bewegung mit analogem Joystick
|
||||
moveX := 0.0
|
||||
if input.Left {
|
||||
@@ -203,40 +211,14 @@ func (g *Game) checkSoloRound() {
|
||||
return
|
||||
}
|
||||
|
||||
// 1. Lokale Todes-Erkennung (Obstacles & Grenzen)
|
||||
// Wir nutzen die vorhergesagte Position
|
||||
pConst := physics.DefaultPlayerConstants()
|
||||
checkX := g.predictedX + pConst.DrawOffX + pConst.HitboxOffX
|
||||
checkY := g.predictedY + pConst.DrawOffY + pConst.HitboxOffY
|
||||
|
||||
// 1. Lokale Todes-Erkennung (Nur noch Grenzen im Solo-Modus)
|
||||
g.stateMutex.Lock()
|
||||
collisionChecker := &physics.ClientCollisionChecker{
|
||||
World: g.world,
|
||||
ActiveChunks: g.gameState.WorldChunks,
|
||||
MovingPlatforms: g.gameState.MovingPlatforms,
|
||||
}
|
||||
scrollX := g.gameState.ScrollX
|
||||
|
||||
hasGodMode := false
|
||||
for _, p := range g.gameState.Players {
|
||||
if p.Name == g.playerName {
|
||||
hasGodMode = p.HasGodMode
|
||||
break
|
||||
}
|
||||
}
|
||||
g.stateMutex.Unlock()
|
||||
|
||||
// Kollision mit Hindernis?
|
||||
hit, colType := collisionChecker.CheckCollision(checkX, checkY, pConst.Width, pConst.Height)
|
||||
|
||||
isDead := false
|
||||
deathReason := ""
|
||||
|
||||
if hit && colType == "obstacle" && !hasGodMode {
|
||||
isDead = true
|
||||
deathReason = "Hindernis berührt"
|
||||
}
|
||||
|
||||
// Aus dem linken Bildschirmrand gefallen?
|
||||
if g.predictedX < scrollX-50 {
|
||||
isDead = true
|
||||
|
||||
Reference in New Issue
Block a user