From 0eaa7b2cdb161fe5f14be7b3762cc0146585c353 Mon Sep 17 00:00:00 2001 From: -=yb4f310 Date: Tue, 21 Nov 2017 17:32:27 +0100 Subject: [PATCH] Initial Commit: CC - Touch Start (2leaoar72c.js) --- 2leaoar72c.js | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 2leaoar72c.js diff --git a/2leaoar72c.js b/2leaoar72c.js new file mode 100644 index 0000000..83ba520 --- /dev/null +++ b/2leaoar72c.js @@ -0,0 +1,25 @@ +data.event.preventDefault(); + +var touches = Object.keys(data); +/** + * This code is rediculous - but it fixes the bug in ios where audio does not play + */ +GameLib.Event.Emit( + GameLib.Event.PLAY_AUDIO, + { + name : 'Audio - Flamethrower' + } +); + +if (touches.length > 2) { + GameLib.Event.Emit(GameLib.Event.MOUSE_DOWN); +} else { + GameLib.Event.Emit( + GameLib.Event.STOP_AUDIO, + { + name : 'Audio - Flamethrower' + } + ); +} + +//@ sourceURL=touchStart.js \ No newline at end of file