From d5d5eaaf9c5905ee71a178e966e1c5e68785dbf5 Mon Sep 17 00:00:00 2001 From: Atlante45 Date: Wed, 2 Mar 2016 23:42:27 -0800 Subject: [PATCH] Fix cooldown --- examples/flappyBird.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/examples/flappyBird.js b/examples/flappyBird.js index d4de629e8d..041535caa5 100644 --- a/examples/flappyBird.js +++ b/examples/flappyBird.js @@ -281,7 +281,9 @@ pipes = new Pipes(space.dimensions.x, space.dimensions.y, to3DPosition); } function inputs(triggerValue) { - if (triggerValue > TRIGGER_THRESHOLD && lastTriggerValue < TRIGGER_THRESHOLD) { + if (triggerValue > TRIGGER_THRESHOLD && + lastTriggerValue < TRIGGER_THRESHOLD && + (gameTime - lastLost) > coolDown) { isJumping = true; startedPlaying = true; }