From 102bf7fc6af64d1473c9796a2dc80a189d2fdd33 Mon Sep 17 00:00:00 2001 From: -=yb4f310 Date: Tue, 3 Apr 2018 21:03:35 +0200 Subject: [PATCH] play dummy audio for touch devices --- src/game-lib-system-input.js | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/game-lib-system-input.js b/src/game-lib-system-input.js index 5831833..c695736 100644 --- a/src/game-lib-system-input.js +++ b/src/game-lib-system-input.js @@ -21,6 +21,8 @@ GameLib.System.Input = function( this.sensitivityCounter = 0; + this.playAudio = true; + this.editorControls = []; this.orbitControls = []; this.firstPersonControls = []; @@ -978,6 +980,18 @@ GameLib.System.Input.prototype.onKeyboardKeyDown = function(event) { GameLib.System.Input.prototype.onTouchStart = function(event) { + if (this.playAudio) { + + GameLib.Event.Emit( + GameLib.Event.PLAY_AUDIO, + { + name : 'Audio - Dummy' + } + ); + + this.playAudio = false; + } + this.sensitivityCounter = 0; this.touches = {};