+ 1
OOP with JS ,, Could you help me with OOJS ? Object-oriented javaScript
Hi This is my code canvas test link https://code.sololearn.com/WCfHDima8J3q/?ref=app I want to clear or make the path of the ball disappear, and let ball still moving without his line Thanks...
4 odpowiedzi
+ 2
Nice!
All you need is a `ctx.clearRect(0, 0, w, h)` over the whole screen before you draw the ball. Either in your draw function but inside the start function is probably a better place.
+ 2
Thank you Schindlabua this is what i want... 👍👍
Did you think my code is ( good practice ) ? This will help me, because i can rewrite the same canvas in different way.
+ 2
Yep looks pretty good!
I would make it so the draw function takes the ctx as an argument so the Ball doesn't have to rely on global variables. But that's a really minor thing.
+ 1
Thanks my dear 👍.Schindlabua