From e7040471f15d755e440666421152781573353ac7 Mon Sep 17 00:00:00 2001 From: Erico Vieira Porto Date: Sun, 13 Nov 2016 20:18:33 -0200 Subject: [PATCH] addin action playSound --- src/actions.js | 5 +++++ src/engine.js | 4 ++++ 2 files changed, 9 insertions(+) diff --git a/src/actions.js b/src/actions.js index d11bc20..a97f15c 100644 --- a/src/actions.js +++ b/src/actions.js @@ -128,6 +128,11 @@ actions.playMusic = function(param) { engine.atomStack.push([engine.actions.playMusic, params]); } +actions.playSound = function(param) { + var params = param.split(';') + engine.atomStack.push([engine.actions.playSound, params]); +} + actions.teleport = function(param, position) { var params = param.split(';') engine.atomStack.push([function() { diff --git a/src/engine.js b/src/engine.js index b1e40a3..6038975 100644 --- a/src/engine.js +++ b/src/engine.js @@ -511,6 +511,10 @@ engine.actions.playMusic = function(param) { bgmusic.play(param[0]); } +engine.actions.playSound = function(param) { + sound.play(param[0]); +} + engine.actions.teleportInPlace = function(param) { var px = Math.floor(player.mapx / 32), py = Math.floor(player.mapy / 32) + 1;