diff --git a/assets/sounds/effects/time_travel.mp3 b/assets/sounds/effects/time_travel.mp3 new file mode 100644 index 0000000..9543b3e Binary files /dev/null and b/assets/sounds/effects/time_travel.mp3 differ diff --git a/core/src/main/kotlin/com/last/commit/audio/GameSoundEffect.kt b/core/src/main/kotlin/com/last/commit/audio/GameSoundEffect.kt index c45673d..747daff 100644 --- a/core/src/main/kotlin/com/last/commit/audio/GameSoundEffect.kt +++ b/core/src/main/kotlin/com/last/commit/audio/GameSoundEffect.kt @@ -13,5 +13,6 @@ public class GameSoundEffect(name: String): GameSound(name) { val DOOR_OPEN = GameSoundEffect("door_open.mp3") val DOOR_CLOSE = GameSoundEffect("door_close.mp3") + val TIME_TRAVEL = GameSoundEffect("time_travel.mp3") } } \ No newline at end of file diff --git a/core/src/main/kotlin/com/last/commit/map/TimeMap.kt b/core/src/main/kotlin/com/last/commit/map/TimeMap.kt index 1f7627b..1553f3b 100644 --- a/core/src/main/kotlin/com/last/commit/map/TimeMap.kt +++ b/core/src/main/kotlin/com/last/commit/map/TimeMap.kt @@ -14,6 +14,7 @@ import com.badlogic.gdx.utils.Array import com.last.commit.Collidable import com.last.commit.Player import com.last.commit.Wall +import com.last.commit.audio.GameSoundEffect import Position import GameState @@ -50,6 +51,7 @@ class TimeMap(fileName: String, val state: GameState) { for (teleporter in teleporters) { if (teleporter is RectangleMapObject) { if (teleporter.rectangle.contains(player.getX(), player.getY())) { + state.soundEngine.play(GameSoundEffect.TIME_TRAVEL) val targetMap = teleporter.properties.get("target", String::class.java) System.out.println("Teleporting to targetMap $targetMap") map = mapLoader.load("tiled/$targetMap") @@ -67,6 +69,7 @@ class TimeMap(fileName: String, val state: GameState) { fun getPlayerSpawn(): Vector2 { val mapLayers = map.layers val spawnPoints = mapLayers["Spawnpoints"].objects + for (spawnPoint in spawnPoints) { val spawnPointProperties = spawnPoint.properties if (spawnPointProperties != null && spawnPointProperties.containsKey("playerSpawn")) {