Private
Public Access
1
0

add presentation mode: implement presentation logic, QR code support, animated quotes, assets display, and emotes
Some checks failed
Dynamic Branch Deploy / build-and-deploy (push) Failing after 1m33s

This commit is contained in:
Sebastian Unterschütz
2026-04-22 20:00:48 +02:00
parent 568ce516e7
commit e71fd6f0ee
8 changed files with 382 additions and 3 deletions

View File

@@ -342,6 +342,12 @@ func (r *Room) HandleInput(input game.ClientInput) {
if input.PlayerID == r.HostID && r.Status == "LOBBY" {
r.StartCountdown()
}
case "START_PRESENTATION":
if input.PlayerID == r.HostID && r.Status == "LOBBY" {
r.Status = "PRESENTATION"
r.GameStartTime = time.Now()
r.CurrentSpeed = 0
}
case "SET_TEAM_NAME":
// Nur Host darf Team-Name setzen und nur in der Lobby
if input.PlayerID == r.HostID && r.Status == "LOBBY" {
@@ -349,6 +355,19 @@ func (r *Room) HandleInput(input game.ClientInput) {
log.Printf("🏷️ Team-Name gesetzt: '%s' (von Host %s)", r.TeamName, p.Name)
}
}
// Emote Handling (z.B. EMOTE_1, EMOTE_2)
if len(input.Type) > 6 && input.Type[:6] == "EMOTE_" {
p.State = input.Type
// Emote nach 2 Sekunden zurücksetzen
go func(player *ServerPlayer, emote string) {
time.Sleep(2 * time.Second)
if player.State == emote {
player.State = ""
}
}(p, input.Type)
}
}
func (r *Room) StartCountdown() {
@@ -388,6 +407,11 @@ func (r *Room) Update() {
r.GlobalScrollX += r.CurrentSpeed
// Bewegende Plattformen updaten
r.UpdateMovingPlatforms()
} else if r.Status == "PRESENTATION" {
// Keine Kamera-Bewegung, keine Schwierigkeitssteigerung, aber Physik läuft weiter
r.CurrentSpeed = 0
// Bewegende Plattformen können sich auch hier bewegen, wenn gewünscht
r.UpdateMovingPlatforms()
}
maxX := r.GlobalScrollX