feat(nds): add audio in all menus
This commit is contained in:
@@ -6,6 +6,7 @@ const app = useAppStore();
|
||||
const store = useSettingsStore();
|
||||
const achievements = useAchievementsStore();
|
||||
const confirmationModal = useConfirmationModal();
|
||||
const { assets } = useAssets();
|
||||
|
||||
const { onRender, onClick } = useScreen();
|
||||
|
||||
@@ -161,7 +162,7 @@ const handleActivateB = () => {
|
||||
onClosed: async (choice) => {
|
||||
if (choice === "A") {
|
||||
await animateOutro();
|
||||
store.closeSubMenu();
|
||||
store.closeSubMenu(true);
|
||||
} else {
|
||||
state.value = "playing";
|
||||
}
|
||||
@@ -190,6 +191,7 @@ const handleActivateA = async () => {
|
||||
},
|
||||
});
|
||||
} else if (state.value === "waiting") {
|
||||
assets.audio.menuConfirmed.play();
|
||||
await gsap.to(animation, {
|
||||
areaOpacity: 0,
|
||||
duration: AREA_FADE_DURATION,
|
||||
@@ -264,7 +266,7 @@ const showDeathScreen = () => {
|
||||
resetGame();
|
||||
} else {
|
||||
await animateOutro();
|
||||
store.closeSubMenu();
|
||||
store.closeSubMenu(true);
|
||||
}
|
||||
},
|
||||
keepButtonsDown: (choice) => choice === "B",
|
||||
@@ -286,6 +288,7 @@ onClick((mx, my) => {
|
||||
const distance = Math.sqrt(dx * dx + dy * dy);
|
||||
|
||||
if (distance <= circle.radius) {
|
||||
assets.audio.type.play(0.35);
|
||||
rings.push({
|
||||
x: circle.x,
|
||||
y: circle.y,
|
||||
@@ -336,7 +339,10 @@ onRender((ctx, deltaTime) => {
|
||||
lives--;
|
||||
if (lives <= 0) {
|
||||
state.value = "ended";
|
||||
assets.audio.invalid.play();
|
||||
showDeathScreen();
|
||||
} else {
|
||||
assets.audio.eraser.play();
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user