Add sound to teleportation

This commit is contained in:
Pierre HUBERT 2020-04-01 13:32:53 +02:00
parent f6e30ed37e
commit d39470e3ca
2 changed files with 2 additions and 0 deletions

BIN
assets/teleportation.mp3 Normal file

Binary file not shown.

View File

@ -285,6 +285,8 @@ async function startGame(gameID) {
case TELEPORTATION: case TELEPORTATION:
playAudio("assets/teleportation.mp3");
// Teleport the snake to the other cell // Teleport the snake to the other cell
const possibleDestinations = teleportationCells.filter((v) => v[0] != newHead[0] && v[1] != newHead[1]); const possibleDestinations = teleportationCells.filter((v) => v[0] != newHead[0] && v[1] != newHead[1]);
const chosenDestination = possibleDestinations[randInt(0, possibleDestinations.length)]; const chosenDestination = possibleDestinations[randInt(0, possibleDestinations.length)];