Skip to content
This repository has been archived by the owner on Mar 3, 2024. It is now read-only.

Commit

Permalink
addin action playSound
Browse files Browse the repository at this point in the history
  • Loading branch information
ericoporto committed Nov 13, 2016
1 parent 0348757 commit e704047
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/actions.js
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down
4 changes: 4 additions & 0 deletions src/engine.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit e704047

Please sign in to comment.