feat(nds): add audio in all menus
This commit is contained in:
@@ -120,7 +120,7 @@ const handleActivateB = async () => {
|
||||
onClosed: async (choice) => {
|
||||
if (choice === "A") {
|
||||
await animateOutro();
|
||||
store.closeSubMenu();
|
||||
store.closeSubMenu(true);
|
||||
} else {
|
||||
state.value = "alive";
|
||||
}
|
||||
@@ -160,6 +160,7 @@ const handleActivateA = () => {
|
||||
}
|
||||
|
||||
case "waiting": {
|
||||
atlas.audio.menuConfirmed.play();
|
||||
spawn();
|
||||
break;
|
||||
}
|
||||
@@ -207,6 +208,8 @@ const eat = () => {
|
||||
food.copy(randomFoodPos());
|
||||
score += 1;
|
||||
|
||||
atlas.audio.duplicate.play(0.35);
|
||||
|
||||
if (score === 40) {
|
||||
achievements.unlock("snake_score_25");
|
||||
}
|
||||
@@ -214,6 +217,7 @@ const eat = () => {
|
||||
|
||||
const die = () => {
|
||||
state.value = "dead";
|
||||
atlas.audio.invalid.play();
|
||||
};
|
||||
|
||||
const spawn = () => {
|
||||
@@ -351,6 +355,7 @@ useKeyDown(({ key }) => {
|
||||
|
||||
if (newDirection.clone().dot(direction) === 0) {
|
||||
nextDirection.copy(newDirection);
|
||||
atlas.audio.type.play(0.35);
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user