534 lines
15 KiB
Go
534 lines
15 KiB
Go
package main
|
|
|
|
import (
|
|
"fmt"
|
|
"image/color"
|
|
"log"
|
|
"math"
|
|
"sort"
|
|
"time"
|
|
|
|
"git.zb-server.de/ZB-Server/EscapeFromTeacher/pkg/game"
|
|
"github.com/hajimehoshi/ebiten/v2"
|
|
"github.com/hajimehoshi/ebiten/v2/inpututil"
|
|
"github.com/hajimehoshi/ebiten/v2/text"
|
|
"github.com/hajimehoshi/ebiten/v2/vector"
|
|
"golang.org/x/image/font/basicfont"
|
|
)
|
|
|
|
// --- INPUT & UPDATE LOGIC ---
|
|
|
|
func (g *Game) UpdateGame() {
|
|
// --- 1. KEYBOARD INPUT ---
|
|
keyLeft := ebiten.IsKeyPressed(ebiten.KeyA) || ebiten.IsKeyPressed(ebiten.KeyLeft)
|
|
keyRight := ebiten.IsKeyPressed(ebiten.KeyD) || ebiten.IsKeyPressed(ebiten.KeyRight)
|
|
keyDown := inpututil.IsKeyJustPressed(ebiten.KeyS) || inpututil.IsKeyJustPressed(ebiten.KeyDown)
|
|
keyJump := inpututil.IsKeyJustPressed(ebiten.KeySpace) || inpututil.IsKeyJustPressed(ebiten.KeyW) || inpututil.IsKeyJustPressed(ebiten.KeyUp)
|
|
|
|
// --- 2. TOUCH INPUT HANDLING ---
|
|
g.handleTouchInput()
|
|
|
|
// --- 3. INPUT STATE ERSTELLEN ---
|
|
joyDir := 0.0
|
|
if g.joyActive {
|
|
diffX := g.joyStickX - g.joyBaseX
|
|
if diffX < -20 {
|
|
joyDir = -1
|
|
}
|
|
if diffX > 20 {
|
|
joyDir = 1
|
|
}
|
|
}
|
|
|
|
isJoyDown := g.joyActive && (g.joyStickY-g.joyBaseY) > 40
|
|
|
|
// Input State zusammenbauen
|
|
input := InputState{
|
|
Sequence: g.inputSequence,
|
|
Left: keyLeft || joyDir == -1,
|
|
Right: keyRight || joyDir == 1,
|
|
Jump: keyJump || g.btnJumpActive,
|
|
Down: keyDown || isJoyDown,
|
|
}
|
|
g.btnJumpActive = false
|
|
|
|
// --- 4. CLIENT PREDICTION ---
|
|
if g.connected {
|
|
g.predictionMutex.Lock()
|
|
// Sequenznummer erhöhen
|
|
g.inputSequence++
|
|
input.Sequence = g.inputSequence
|
|
|
|
// Input speichern für später Reconciliation
|
|
g.pendingInputs[input.Sequence] = input
|
|
|
|
// Lokale Physik sofort anwenden (Prediction)
|
|
g.ApplyInput(input)
|
|
g.predictionMutex.Unlock()
|
|
|
|
// Input an Server senden
|
|
g.SendInputWithSequence(input)
|
|
}
|
|
|
|
// --- 5. KAMERA LOGIK ---
|
|
g.stateMutex.Lock()
|
|
defer g.stateMutex.Unlock()
|
|
|
|
// Wir folgen strikt dem Server-Scroll.
|
|
targetCam := g.gameState.ScrollX
|
|
|
|
// Negative Kamera verhindern
|
|
if targetCam < 0 {
|
|
targetCam = 0
|
|
}
|
|
|
|
// Kamera hart setzen
|
|
g.camX = targetCam
|
|
}
|
|
|
|
// Verarbeitet Touch-Eingaben für Joystick und Buttons
|
|
func (g *Game) handleTouchInput() {
|
|
touches := ebiten.TouchIDs()
|
|
|
|
// Reset, wenn keine Finger mehr auf dem Display sind
|
|
if len(touches) == 0 {
|
|
g.joyActive = false
|
|
g.joyStickX = g.joyBaseX
|
|
g.joyStickY = g.joyBaseY
|
|
return
|
|
}
|
|
|
|
joyFound := false
|
|
|
|
for _, id := range touches {
|
|
x, y := ebiten.TouchPosition(id)
|
|
fx, fy := float64(x), float64(y)
|
|
|
|
// 1. RECHTE SEITE: JUMP BUTTON
|
|
// Alles rechts der Bildschirmmitte ist "Springen"
|
|
if fx > ScreenWidth/2 {
|
|
// Prüfen, ob dieser Touch gerade NEU dazu gekommen ist
|
|
for _, justID := range inpututil.JustPressedTouchIDs() {
|
|
if id == justID {
|
|
g.btnJumpActive = true
|
|
break
|
|
}
|
|
}
|
|
continue
|
|
}
|
|
|
|
// 2. LINKE SEITE: JOYSTICK
|
|
// Wenn wir noch keinen Joystick-Finger haben, prüfen wir, ob dieser Finger startet
|
|
if !g.joyActive {
|
|
// Prüfen ob Touch in der Nähe der Joystick-Basis ist (Radius 150 Toleranz)
|
|
dist := math.Sqrt(math.Pow(fx-g.joyBaseX, 2) + math.Pow(fy-g.joyBaseY, 2))
|
|
if dist < 150 {
|
|
g.joyActive = true
|
|
g.joyTouchID = id
|
|
}
|
|
}
|
|
|
|
// Wenn das der Joystick-Finger ist -> Stick bewegen
|
|
if g.joyActive && id == g.joyTouchID {
|
|
joyFound = true
|
|
|
|
// Vektor berechnen (Wie weit ziehen wir weg?)
|
|
dx := fx - g.joyBaseX
|
|
dy := fy - g.joyBaseY
|
|
dist := math.Sqrt(dx*dx + dy*dy)
|
|
maxDist := 60.0 // Maximaler Radius des Sticks
|
|
|
|
// Begrenzen auf Radius
|
|
if dist > maxDist {
|
|
scale := maxDist / dist
|
|
dx *= scale
|
|
dy *= scale
|
|
}
|
|
|
|
g.joyStickX = g.joyBaseX + dx
|
|
g.joyStickY = g.joyBaseY + dy
|
|
}
|
|
}
|
|
|
|
// Wenn der Joystick-Finger losgelassen wurde, Joystick resetten
|
|
if !joyFound {
|
|
g.joyActive = false
|
|
g.joyStickX = g.joyBaseX
|
|
g.joyStickY = g.joyBaseY
|
|
}
|
|
}
|
|
|
|
// --- RENDERING LOGIC ---
|
|
|
|
func (g *Game) DrawGame(screen *ebiten.Image) {
|
|
// WICHTIG: GAMEOVER-Check ZUERST, bevor wir Locks holen!
|
|
g.stateMutex.Lock()
|
|
status := g.gameState.Status
|
|
g.stateMutex.Unlock()
|
|
|
|
if status == "GAMEOVER" {
|
|
// Game Over Screen - komplett separates Rendering ohne weitere Locks
|
|
g.stateMutex.Lock()
|
|
myScore := 0
|
|
for _, p := range g.gameState.Players {
|
|
if p.Name == g.playerName {
|
|
myScore = p.Score
|
|
break
|
|
}
|
|
}
|
|
g.stateMutex.Unlock()
|
|
|
|
g.DrawGameOverLeaderboard(screen, myScore)
|
|
return // Früher Return, damit Game-UI nicht mehr gezeichnet wird
|
|
}
|
|
|
|
// State Locken für Datenzugriff
|
|
g.stateMutex.Lock()
|
|
|
|
// Prüfe ob Spieler tot ist
|
|
isDead := false
|
|
myScore := 0
|
|
for _, p := range g.gameState.Players {
|
|
if p.Name == g.playerName {
|
|
isDead = !p.IsAlive || p.IsSpectator
|
|
myScore = p.Score
|
|
break
|
|
}
|
|
}
|
|
g.stateMutex.Unlock()
|
|
|
|
// 1. Hintergrund & Boden
|
|
screen.Fill(ColSky)
|
|
|
|
floorH := float32(ScreenHeight - RefFloorY)
|
|
vector.DrawFilledRect(screen, 0, float32(RefFloorY), float32(ScreenWidth), floorH, ColGrass, false)
|
|
vector.DrawFilledRect(screen, 0, float32(RefFloorY)+20, float32(ScreenWidth), floorH-20, ColDirt, false)
|
|
|
|
// State Locken für Datenzugriff
|
|
g.stateMutex.Lock()
|
|
defer g.stateMutex.Unlock()
|
|
|
|
// 2. Chunks (Welt-Objekte)
|
|
for _, activeChunk := range g.gameState.WorldChunks {
|
|
chunkDef, exists := g.world.ChunkLibrary[activeChunk.ChunkID]
|
|
if !exists {
|
|
log.Printf("⚠️ Chunk '%s' nicht in Library gefunden!", activeChunk.ChunkID)
|
|
continue
|
|
}
|
|
|
|
// Start-Chunk hat absichtlich keine Objekte
|
|
|
|
for _, obj := range chunkDef.Objects {
|
|
// Asset zeichnen
|
|
g.DrawAsset(screen, obj.AssetID, activeChunk.X+obj.X, obj.Y)
|
|
}
|
|
}
|
|
|
|
// 3. Spieler
|
|
// MyID ohne Lock holen (wir haben bereits den stateMutex)
|
|
myID := ""
|
|
for id, p := range g.gameState.Players {
|
|
if p.Name == g.playerName {
|
|
myID = id
|
|
break
|
|
}
|
|
}
|
|
|
|
for id, p := range g.gameState.Players {
|
|
// Für lokalen Spieler: Verwende vorhergesagte Position
|
|
posX, posY := p.X, p.Y
|
|
if id == myID && g.connected {
|
|
posX = g.predictedX
|
|
posY = g.predictedY
|
|
}
|
|
|
|
g.DrawAsset(screen, "player", posX, posY)
|
|
|
|
// Name Tag
|
|
name := p.Name
|
|
if name == "" {
|
|
name = id
|
|
}
|
|
text.Draw(screen, name, basicfont.Face7x13, int(posX-g.camX), int(posY-25), ColText)
|
|
|
|
// DEBUG: Rote Hitbox
|
|
if def, ok := g.world.Manifest.Assets["player"]; ok {
|
|
hx := float32(posX + def.DrawOffX + def.Hitbox.OffsetX - g.camX)
|
|
hy := float32(posY + def.DrawOffY + def.Hitbox.OffsetY)
|
|
vector.StrokeRect(screen, hx, hy, float32(def.Hitbox.W), float32(def.Hitbox.H), 2, color.RGBA{255, 0, 0, 255}, false)
|
|
}
|
|
}
|
|
|
|
// 4. UI Status
|
|
if g.gameState.Status == "COUNTDOWN" {
|
|
msg := fmt.Sprintf("GO IN: %d", g.gameState.TimeLeft)
|
|
text.Draw(screen, msg, basicfont.Face7x13, ScreenWidth/2-40, ScreenHeight/2, color.RGBA{255, 255, 0, 255})
|
|
} else if g.gameState.Status == "RUNNING" {
|
|
dist := fmt.Sprintf("Distance: %.0f m", g.camX/64.0)
|
|
text.Draw(screen, dist, basicfont.Face7x13, ScreenWidth-150, 30, ColText)
|
|
|
|
// Score anzeigen
|
|
scoreStr := fmt.Sprintf("Score: %d", myScore)
|
|
text.Draw(screen, scoreStr, basicfont.Face7x13, ScreenWidth-150, 50, ColText)
|
|
|
|
// Spectator Overlay wenn tot
|
|
if isDead {
|
|
// Halbtransparenter roter Overlay
|
|
vector.DrawFilledRect(screen, 0, 0, ScreenWidth, 80, color.RGBA{150, 0, 0, 180}, false)
|
|
text.Draw(screen, "☠ DU BIST TOT - SPECTATOR MODE ☠", basicfont.Face7x13, ScreenWidth/2-140, 30, color.White)
|
|
text.Draw(screen, fmt.Sprintf("Dein Final Score: %d", myScore), basicfont.Face7x13, ScreenWidth/2-90, 55, color.RGBA{255, 255, 0, 255})
|
|
}
|
|
}
|
|
|
|
// 5. DEBUG: TODES-LINIE
|
|
vector.StrokeLine(screen, 0, 0, 0, float32(ScreenHeight), 10, color.RGBA{255, 0, 0, 128}, false)
|
|
text.Draw(screen, "! DEATH ZONE !", basicfont.Face7x13, 10, ScreenHeight/2, color.RGBA{255, 0, 0, 255})
|
|
|
|
// 6. TOUCH CONTROLS OVERLAY
|
|
|
|
// A) Joystick Base
|
|
baseCol := color.RGBA{255, 255, 255, 50}
|
|
vector.DrawFilledCircle(screen, float32(g.joyBaseX), float32(g.joyBaseY), 60, baseCol, true)
|
|
vector.StrokeCircle(screen, float32(g.joyBaseX), float32(g.joyBaseY), 60, 2, color.RGBA{255, 255, 255, 100}, true)
|
|
|
|
// B) Joystick Knob
|
|
knobCol := color.RGBA{255, 255, 255, 150}
|
|
if g.joyActive {
|
|
knobCol = color.RGBA{100, 255, 100, 200}
|
|
}
|
|
vector.DrawFilledCircle(screen, float32(g.joyStickX), float32(g.joyStickY), 30, knobCol, true)
|
|
|
|
// C) Jump Button (Rechts)
|
|
jumpX := float32(ScreenWidth - 150)
|
|
jumpY := float32(ScreenHeight - 150)
|
|
vector.DrawFilledCircle(screen, jumpX, jumpY, 50, color.RGBA{255, 0, 0, 50}, true)
|
|
vector.StrokeCircle(screen, jumpX, jumpY, 50, 2, color.RGBA{255, 0, 0, 100}, true)
|
|
text.Draw(screen, "JUMP", basicfont.Face7x13, int(jumpX)-15, int(jumpY)+5, color.White)
|
|
|
|
// 7. DEBUG INFO (Oben Links)
|
|
myPosStr := "N/A"
|
|
for _, p := range g.gameState.Players {
|
|
myPosStr = fmt.Sprintf("X:%.0f Y:%.0f", p.X, p.Y)
|
|
break
|
|
}
|
|
|
|
debugMsg := fmt.Sprintf(
|
|
"FPS: %.2f\nState: %s\nPlayers: %d\nCamX: %.0f\nPos: %s",
|
|
ebiten.CurrentFPS(),
|
|
g.gameState.Status,
|
|
len(g.gameState.Players),
|
|
g.camX,
|
|
myPosStr,
|
|
)
|
|
|
|
vector.DrawFilledRect(screen, 10, 10, 200, 90, color.RGBA{0, 0, 0, 180}, false)
|
|
text.Draw(screen, debugMsg, basicfont.Face7x13, 20, 30, color.White)
|
|
}
|
|
|
|
// --- ASSET HELPER ---
|
|
|
|
func (g *Game) DrawAsset(screen *ebiten.Image, assetID string, worldX, worldY float64) {
|
|
// 1. Definition laden
|
|
def, ok := g.world.Manifest.Assets[assetID]
|
|
if !ok {
|
|
return
|
|
}
|
|
|
|
// 2. Screen Position berechnen (Welt - Kamera)
|
|
screenX := worldX - g.camX
|
|
screenY := worldY
|
|
|
|
// Optimierung: Nicht zeichnen, wenn komplett außerhalb
|
|
if screenX < -200 || screenX > ScreenWidth+200 {
|
|
return
|
|
}
|
|
|
|
// 3. Bild holen
|
|
img := g.assetsImages[assetID]
|
|
|
|
if img != nil {
|
|
op := &ebiten.DrawImageOptions{}
|
|
|
|
// Filter für bessere Skalierung (besonders bei großen Sprites)
|
|
op.Filter = ebiten.FilterLinear
|
|
|
|
// Skalieren
|
|
op.GeoM.Scale(def.Scale, def.Scale)
|
|
|
|
// Positionieren: ScreenPos + DrawOffset
|
|
op.GeoM.Translate(
|
|
screenX+def.DrawOffX,
|
|
screenY+def.DrawOffY,
|
|
)
|
|
|
|
// Farbe anwenden (nur wenn explizit gesetzt)
|
|
// Wenn Color leer ist (R=G=B=A=0), nicht anwenden (Bild bleibt original)
|
|
if def.Color.R != 0 || def.Color.G != 0 || def.Color.B != 0 || def.Color.A != 0 {
|
|
op.ColorScale.ScaleWithColor(def.Color.ToRGBA())
|
|
}
|
|
|
|
screen.DrawImage(img, op)
|
|
} else {
|
|
// FALLBACK (Buntes Rechteck)
|
|
vector.DrawFilledRect(screen,
|
|
float32(screenX+def.Hitbox.OffsetX),
|
|
float32(screenY+def.Hitbox.OffsetY),
|
|
float32(def.Hitbox.W),
|
|
float32(def.Hitbox.H),
|
|
def.Color.ToRGBA(),
|
|
false,
|
|
)
|
|
}
|
|
}
|
|
|
|
// DrawGameOverLeaderboard zeigt Leaderboard mit Team-Name-Eingabe
|
|
func (g *Game) DrawGameOverLeaderboard(screen *ebiten.Image, myScore int) {
|
|
screen.Fill(color.RGBA{20, 20, 30, 255})
|
|
|
|
// Leaderboard immer beim ersten Mal anfordern (ohne Lock hier!)
|
|
if !g.scoreSubmitted && g.gameMode == "solo" {
|
|
g.submitScore() // submitScore() ruft requestLeaderboard() auf
|
|
} else {
|
|
// Für Coop: Nur Leaderboard anfordern, nicht submitten
|
|
g.leaderboardMutex.Lock()
|
|
needsLeaderboard := len(g.leaderboard) == 0 && g.connected
|
|
g.leaderboardMutex.Unlock()
|
|
|
|
if needsLeaderboard {
|
|
g.requestLeaderboard()
|
|
}
|
|
}
|
|
|
|
// Großes GAME OVER
|
|
text.Draw(screen, "GAME OVER", basicfont.Face7x13, ScreenWidth/2-50, 60, color.RGBA{255, 0, 0, 255})
|
|
|
|
// Linke Seite: Raum-Ergebnisse - Daten KOPIEREN mit Lock, dann außerhalb zeichnen
|
|
text.Draw(screen, "=== RAUM ERGEBNISSE ===", basicfont.Face7x13, 50, 120, color.RGBA{255, 255, 0, 255})
|
|
|
|
type playerScore struct {
|
|
name string
|
|
score int
|
|
}
|
|
|
|
// Lock NUR für Datenkopie
|
|
g.stateMutex.Lock()
|
|
players := make([]playerScore, 0, len(g.gameState.Players))
|
|
for _, p := range g.gameState.Players {
|
|
players = append(players, playerScore{name: p.Name, score: p.Score})
|
|
}
|
|
g.stateMutex.Unlock()
|
|
|
|
// Sortieren und Zeichnen OHNE Lock
|
|
sort.Slice(players, func(i, j int) bool {
|
|
return players[i].score > players[j].score
|
|
})
|
|
|
|
y := 150
|
|
for i, p := range players {
|
|
medal := ""
|
|
if i == 0 {
|
|
medal = "🥇 "
|
|
} else if i == 1 {
|
|
medal = "🥈 "
|
|
} else if i == 2 {
|
|
medal = "🥉 "
|
|
}
|
|
scoreMsg := fmt.Sprintf("%d. %s%s: %d pts", i+1, medal, p.name, p.score)
|
|
text.Draw(screen, scoreMsg, basicfont.Face7x13, 50, y, color.White)
|
|
y += 20
|
|
}
|
|
|
|
// Rechte Seite: Global Leaderboard - Daten KOPIEREN mit Lock, dann außerhalb zeichnen
|
|
text.Draw(screen, "=== TOP 10 BESTENLISTE ===", basicfont.Face7x13, 650, 120, color.RGBA{255, 215, 0, 255})
|
|
|
|
// Lock NUR für Datenkopie
|
|
g.leaderboardMutex.Lock()
|
|
leaderboardCopy := make([]game.LeaderboardEntry, len(g.leaderboard))
|
|
copy(leaderboardCopy, g.leaderboard)
|
|
g.leaderboardMutex.Unlock()
|
|
|
|
// Zeichnen OHNE Lock
|
|
ly := 150
|
|
if len(leaderboardCopy) == 0 {
|
|
text.Draw(screen, "Laden...", basicfont.Face7x13, 700, ly, color.Gray{150})
|
|
} else {
|
|
for i, entry := range leaderboardCopy {
|
|
if i >= 10 {
|
|
break
|
|
}
|
|
var col color.Color = color.White
|
|
marker := ""
|
|
if entry.PlayerCode == g.playerCode {
|
|
col = color.RGBA{0, 255, 0, 255}
|
|
marker = " ← DU"
|
|
}
|
|
medal := ""
|
|
if i == 0 {
|
|
medal = "🥇 "
|
|
} else if i == 1 {
|
|
medal = "🥈 "
|
|
} else if i == 2 {
|
|
medal = "🥉 "
|
|
}
|
|
leaderMsg := fmt.Sprintf("%d. %s%s: %d%s", i+1, medal, entry.PlayerName, entry.Score, marker)
|
|
text.Draw(screen, leaderMsg, basicfont.Face7x13, 650, ly, col)
|
|
ly += 20
|
|
}
|
|
}
|
|
|
|
// Team-Name-Eingabe nur für Coop-Host (in der Mitte unten)
|
|
if g.gameMode == "coop" && g.isHost {
|
|
text.Draw(screen, "Host: Gib Team-Namen ein", basicfont.Face7x13, ScreenWidth/2-100, ScreenHeight-180, color.RGBA{255, 215, 0, 255})
|
|
|
|
// Team-Name Feld
|
|
fieldW := 300
|
|
fieldX := ScreenWidth/2 - fieldW/2
|
|
fieldY := ScreenHeight - 140
|
|
|
|
col := color.RGBA{70, 70, 80, 255}
|
|
if g.activeField == "teamname" {
|
|
col = color.RGBA{90, 90, 100, 255}
|
|
}
|
|
vector.DrawFilledRect(screen, float32(fieldX), float32(fieldY), float32(fieldW), 40, col, false)
|
|
vector.StrokeRect(screen, float32(fieldX), float32(fieldY), float32(fieldW), 40, 2, color.RGBA{255, 215, 0, 255}, false)
|
|
|
|
display := g.teamName
|
|
if g.activeField == "teamname" && (time.Now().UnixMilli()/500)%2 == 0 {
|
|
display += "|"
|
|
}
|
|
if display == "" {
|
|
display = "Team Name..."
|
|
}
|
|
text.Draw(screen, display, basicfont.Face7x13, fieldX+10, fieldY+25, color.White)
|
|
|
|
// Submit Button
|
|
submitBtnY := ScreenHeight - 85
|
|
submitBtnW := 200
|
|
submitBtnX := ScreenWidth/2 - submitBtnW/2
|
|
|
|
btnCol := color.RGBA{0, 150, 0, 255}
|
|
if g.teamName == "" {
|
|
btnCol = color.RGBA{100, 100, 100, 255} // Grau wenn kein Name
|
|
}
|
|
vector.DrawFilledRect(screen, float32(submitBtnX), float32(submitBtnY), float32(submitBtnW), 40, btnCol, false)
|
|
vector.StrokeRect(screen, float32(submitBtnX), float32(submitBtnY), float32(submitBtnW), 40, 2, color.White, false)
|
|
text.Draw(screen, "SUBMIT SCORE", basicfont.Face7x13, submitBtnX+50, submitBtnY+25, color.White)
|
|
} else if g.gameMode == "solo" && g.scoreSubmitted {
|
|
// Solo: Zeige Bestätigungsmeldung
|
|
text.Draw(screen, "Score eingereicht!", basicfont.Face7x13, ScreenWidth/2-70, ScreenHeight-100, color.RGBA{0, 255, 0, 255})
|
|
} else if g.gameMode == "coop" && !g.isHost {
|
|
// Coop Non-Host: Warten auf Host
|
|
text.Draw(screen, "Warte auf Host...", basicfont.Face7x13, ScreenWidth/2-70, ScreenHeight-100, color.Gray{180})
|
|
}
|
|
|
|
// Back Button (oben links)
|
|
backBtnW, backBtnH := 120, 40
|
|
backBtnX, backBtnY := 20, 20
|
|
vector.DrawFilledRect(screen, float32(backBtnX), float32(backBtnY), float32(backBtnW), float32(backBtnH), color.RGBA{150, 0, 0, 255}, false)
|
|
vector.StrokeRect(screen, float32(backBtnX), float32(backBtnY), float32(backBtnW), float32(backBtnH), 2, color.White, false)
|
|
text.Draw(screen, "< ZURÜCK", basicfont.Face7x13, backBtnX+20, backBtnY+25, color.White)
|
|
|
|
// Unten: Anleitung
|
|
text.Draw(screen, "ESC oder ZURÜCK-Button = Menü", basicfont.Face7x13, ScreenWidth/2-110, ScreenHeight-30, color.Gray{180})
|
|
}
|