+ 2

Is this realistic enough?

I tried to get this simulation quite real, but idk. https://www.sololearn.com/compiler-playground/WsmIySu18X74/?ref=app

2nd Jul 2025, 2:18 PM
Korijn Jagersma
Korijn Jagersma - avatar
13 odpowiedzi
+ 5
Berlida Yaa The Q&A Forum is for help with coding questions and is not a general chat. If you have a question please start your own thread 😉
2nd Jul 2025, 3:18 PM
Keith
Keith - avatar
+ 3
Please use the share feature in the code playground to copy and paste links in the forum 😉
2nd Jul 2025, 2:31 PM
Keith
Keith - avatar
+ 2
Korijn Jagersma after playing around with your code and making a few adjustments please review the following code... https://sololearn.com/compiler-playground/Wa15d8KciGZ1/?ref=app
2nd Jul 2025, 3:38 PM
BroFar
BroFar - avatar
+ 2
Berlida Yaa please stop spamming the forum threads ...
2nd Jul 2025, 6:11 PM
BroFar
BroFar - avatar
+ 2
PAWAN SWAMI Your post could be considered spam. Please review the community guidelines before posting. Happy coding 😉 https://www.sololearn.com/Discuss/1316935/?ref=app
3rd Jul 2025, 3:53 PM
Keith
Keith - avatar
+ 1
William Gram There are currently no issues with the site. Are you experiencing issues? If so, please start your own thread.
3rd Jul 2025, 8:54 AM
Keith
Keith - avatar
+ 1
I've removed the spammy posts. Do not post in this thread unless it is related to the OP's topic otherwise it too, will be removed and reported.
3rd Jul 2025, 11:58 PM
Keith
Keith - avatar
0
SoloLearn lessons are missing due to a temporary site outage. Try switching URLs g www.sololearn.com http www.sololearn.com or using the mobile app instead.
3rd Jul 2025, 7:35 AM
William Gram
William Gram - avatar
0
The Q&A Forum is for help with coding questions and is not a general chat. If you have a question please start your own thread
4th Jul 2025, 3:22 AM
selvakumarp CSE
selvakumarp CSE - avatar
0
Hey, your code looks really good and simulates the ball under gravity well, including bounce and damping. One tip: always set the height exactly to 0 on impact so the ball doesn’t sink below the floor. Also, it’s better to define a minimum velocity threshold (like below 0.01) where the ball stops moving—this prevents it from bouncing forever and makes it more realistic. For smoother and more accurate animation, using requestAnimationFrame instead of setInterval is recommended, as it syncs better with the browser’s refresh rate and ensures fluid motion. Overall, it’s already very clean and well-structured!
4th Jul 2025, 11:36 AM
Adrian Behr
Adrian Behr - avatar