* Makes the provided element fall down by changing the top property. * @param {HTMLElement} apple
(apple)
| 20 | * @param {HTMLElement} apple |
| 21 | */ |
| 22 | function fallDown(apple) { |
| 23 | if (!(IsPlaying && apple instanceof HTMLElement)) { |
| 24 | return; |
| 25 | } |
| 26 | //store the current top position for future refrence. |
| 27 | apple.setAttribute('data-top', apple.style.top); |
| 28 | //change the top position, this is animated using transition property in CSS |
| 29 | apple.style.top = "380px"; |
| 30 | //increase score |
| 31 | score = score + 5; |
| 32 | //show the score by calling this function |
| 33 | renderScore(); |
| 34 | //hide the apple after it reaches the ground by calling this function |
| 35 | hideFallenApple(apple); |
| 36 | } |
| 37 | |
| 38 | /** |
| 39 | * Hides the provided element by changing the display property. |
nothing calls this directly
no test coverage detected