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
Some checks failed
Dynamic Branch Deploy / build-and-deploy (push) Failing after 1m33s
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user