0
Why ball going out of canvas?
See the update function in the javascript code. https://code.sololearn.com/WpCy1MtOEX8s/?ref=app
8 Antworten
0
check the ball position against the boundary (x being 0, y being 0)
0
Gordon See the update function I have made an if statement there.
0
check the y also.
0
Gordon Same problem exists.
0
Gordon After debugging many times also I couldn't understand why this happens.
0
Bagon Then also there is a bug.
If you lower the canvas height then ball bounces before touching the wall
0
Bagon Now visit I have reduced the canvas size to 250