fix game
All checks were successful
Dynamic Branch Deploy / build-and-deploy (push) Successful in 6m49s
All checks were successful
Dynamic Branch Deploy / build-and-deploy (push) Successful in 6m49s
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user