From 2dce2c4b95bf52b648aa028383e520cf3a440cde Mon Sep 17 00:00:00 2001 From: -=yb4f310 Date: Wed, 22 Nov 2017 10:24:51 +0100 Subject: [PATCH] Initial Commit: CC - Touch Start (pgx4qp38d4.js) --- pgx4qp38d4.js | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 pgx4qp38d4.js diff --git a/pgx4qp38d4.js b/pgx4qp38d4.js new file mode 100644 index 0000000..83ba520 --- /dev/null +++ b/pgx4qp38d4.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