Private
Public Access
1
0

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

This commit is contained in:
Sebastian Unterschütz
2026-03-22 18:46:54 +01:00
parent 656f279a89
commit 6d0d31824e
6 changed files with 265 additions and 9 deletions

View File

@@ -40,6 +40,11 @@ var (
ColDirt = color.RGBA{101, 67, 33, 255}
)
// trailPoint speichert eine Position für den Player-Trail
type trailPoint struct {
X, Y float64
}
// InputState speichert einen einzelnen Input für Replay
type InputState struct {
Sequence uint32
@@ -118,6 +123,11 @@ type Game struct {
correctionOffsetX float64
correctionOffsetY float64
// Screen Shake
shakeFrames int
shakeIntensity float64
shakeBuffer *ebiten.Image
// Particle System
particles []Particle
particlesMutex sync.Mutex
@@ -125,6 +135,10 @@ type Game struct {
lastCollectedCoins map[string]bool // Für Coin-Partikel
lastCollectedPowerups map[string]bool // Für Powerup-Partikel
lastPlayerStates map[string]game.PlayerState // Für Death-Partikel
trail []trailPoint // Player Trail
// Highscore
localHighscore int
// Audio System
audio *AudioSystem
@@ -193,6 +207,7 @@ func NewGame() *Game {
}
g.loadAssets()
g.loadOrCreatePlayerCode()
g.localHighscore = g.loadHighscore()
// Gespeicherten Namen laden
savedName := g.loadPlayerName()
@@ -446,6 +461,11 @@ func (g *Game) DrawMenu(screen *ebiten.Image) {
title := "ESCAPE FROM TEACHER"
text.Draw(screen, title, basicfont.Face7x13, ScreenWidth/2-80, 100, ColText)
if g.localHighscore > 0 {
hsText := fmt.Sprintf("Persönlicher Highscore: %d", g.localHighscore)
text.Draw(screen, hsText, basicfont.Face7x13, ScreenWidth/2-70, 120, color.RGBA{255, 215, 0, 255})
}
// Name-Feld
fieldW := 250
nameX := ScreenWidth/2 - fieldW/2