Skip to content

Commit

Permalink
fix: improve transition when trailing suspect
Browse files Browse the repository at this point in the history
  • Loading branch information
fmaclen committed Jun 5, 2023
1 parent aec79ac commit 8c4a5aa
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
5 changes: 5 additions & 0 deletions src/lib/components/TrailingSuspect.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,11 @@
padding-inline: var(--layout-inline);
background-color: var(--color-neutral-900);
@media (max-width: 512px) {
border-bottom-left-radius: unset;
border-bottom-right-radius: unset;
}
&--danger {
background-color: var(--color-danger);
}
Expand Down
7 changes: 3 additions & 4 deletions src/routes/game/+page.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,7 @@
clock.isWalking = true;
if (!trailingSceneInRoundSeen && !isFirstRound && game.suspect.lastRoundHidingPlace !== index) {
isArtworkHidden = true;
isTrailingSuspect = true;
const nextSuspectScene = (
Expand All @@ -191,12 +192,11 @@
}
isArtworkHidden = true;
clock.fastForward(2);
await delay(DELAY_IN_MS);
currentClueIndex = index;
if (currentRound) artworkPath = currentRound.scenes[index].place.artwork;
await clock.fastForward(2);
}
async function dismissClue(): Promise<void> {
Expand All @@ -213,6 +213,7 @@
showDestinations = false;
showDescription = false;
isArtworkHidden = true;
clock.fastForward(4);
await delay(DELAY_IN_MS);
const { rounds, currentRoundIndex } = game;
Expand Down Expand Up @@ -240,8 +241,6 @@
if (isNextRound) game.currentRoundIndex += 1;
if (isPreviousRound) game.currentRoundIndex -= 1;
await clock.fastForward(4);
// Must reset round after transition
showPostcard = true;
resetRound();
Expand Down

0 comments on commit 8c4a5aa

Please sign in to comment.