0
I am unable to set height boundaries in javascript
I am creating bouncing ball app where bouncing hit to the boundaries and go back problem is that I am unable to define boundary for height. My width boundry working fine no issue in that but in height boundary having some issue. And I am using div element as canvas and using translate property to move the ball inside the div element. I tried different approach but not find appropriate solution. If somebody has knowledge about cordinates type app just help to solve issue and explain it Thank you. https://code.sololearn.com/Wbfa3FTW5rjc/?ref=app
4 odpowiedzi
+ 2
Can you share your code and someone can give you a bit more specific advice?
+ 1
You weren't sending the values and you have a different canvas size to the actual box. On my phone, for example, I had to add an extra 147 to make the ball stop on the bottom line. You'll see it in the code below.
https://code.sololearn.com/W1DyLVMtl9EJ/?ref=app
0
I shared