html 5 gravity attempt inside canvas when hitting the up arrow button<>
This question already has an answer here:
- gravity inside html5 canvas 3 answers
- You should check the X parameter of the ball as well to see if its over the block.
- To simulate gravity you should constantly extract the factor from the speed not the altitude.