{
window.dispatchEvent(new CustomEvent('preserve-race-state', {
detail: {
players: players,
race: race,
event: event,
preservePositions: true
}
}));
}, 50);
}
" @view-scoreboard.window="showScoreboard = true">
Sales Swim Race
Track your sales progress unfold in a fun and competitive swimming race! Each sale propels your swimmer forward... who will reach the finish line first?
- Race against teammates in real-time
- See your swimmer move with every sale
Dive in and start selling!
0 && newPlayers.length > 0) {
// Create a map of current swimmer positions by ID
const positionMap = {};
swimmers.forEach(s => {
positionMap[s.id] = {
x: s.x,
finished: finished,
animating: animating
};
});
// Update with existing positions
prepareSwimmers(newPlayers, positionMap);
// Restore race state
if ($event.detail.preservePositions) {
finished = Object.values(positionMap).some(p => p.finished);
animating = !finished && Object.values(positionMap).some(p => p.animating);
// Handle audio based on race state
if (animating) {
// Resume race sounds if race was in progress
sounds.crowd.play();
sounds.splash1.play();
sounds.splash2.play();
sounds.background_noise.fade(0.12, 0.2, 500);
} else if (finished) {
// Play applause if race was finished
if (!sounds.applause.playing()) {
sounds.applause.play();
}
sounds.background_noise.volume(0.05);
} else {
// Normal state - just background noise
sounds.background_noise.volume(0.12);
}
}
} else {
prepareSwimmers(newPlayers);
}
}
if ($event.detail.race) activeRace = $event.detail.race;
if ($event.detail.event) activeEvent = $event.detail.event;
">
$
SALES SWIM RACE
No swimmers in this race yet!
|
Loading race data...
SCORE
OVERALL STANDINGS
$
No participants in this race yet!
$
No players have sales in this event yet!