feat(nds): add audio in all menus
This commit is contained in:
@@ -17,7 +17,7 @@ const handleActivateB = () => {
|
||||
onClosed: async (choice) => {
|
||||
if (choice === "A") {
|
||||
await animateOutro();
|
||||
store.closeSubMenu();
|
||||
store.closeSubMenu(true);
|
||||
}
|
||||
},
|
||||
keepButtonsDown: (choice) => choice === "A",
|
||||
@@ -460,6 +460,8 @@ const slide = (rowDir: number, colDir: number) => {
|
||||
);
|
||||
if (!changed) return;
|
||||
|
||||
assets.audio.type.play(0.35);
|
||||
|
||||
if (board.some((r) => r.some((c) => c >= 512))) {
|
||||
achievements.unlock("2048_score_512");
|
||||
}
|
||||
@@ -534,11 +536,20 @@ const slide = (rowDir: number, colDir: number) => {
|
||||
}
|
||||
}
|
||||
|
||||
if (mergePairs.length > 0) {
|
||||
const highestMerge = Math.max(...mergePairs.map((p) => p.mergedValue));
|
||||
const boardMax = Math.max(0, ...beforeTiles.map((t) => t.value));
|
||||
if (highestMerge > boardMax) {
|
||||
assets.audio.duplicate.play(0.35);
|
||||
}
|
||||
}
|
||||
|
||||
const spawned = spawnTile();
|
||||
saveState();
|
||||
|
||||
if (isDead()) {
|
||||
buildTilesFromBoard();
|
||||
assets.audio.invalid.play();
|
||||
showRestartModal();
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -181,7 +181,7 @@ const handleActivateA = () => {
|
||||
),
|
||||
onClosed: async () => {
|
||||
await animateOutro();
|
||||
store.closeSubMenu();
|
||||
store.closeSubMenu(true);
|
||||
},
|
||||
keepButtonsDown: true,
|
||||
timeout: 2000,
|
||||
|
||||
@@ -120,7 +120,7 @@ const handleActivateA = () => {
|
||||
: $t("settings.options.renderingMode.confirmation2d"),
|
||||
onClosed: async () => {
|
||||
await animateOutro();
|
||||
store.closeSubMenu();
|
||||
store.closeSubMenu(true);
|
||||
},
|
||||
keepButtonsDown: true,
|
||||
timeout: 2000,
|
||||
|
||||
Reference in New Issue
Block a user