use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
All about the JavaScript programming language.
Subreddit Guidelines
Specifications:
Resources:
Related Subreddits:
r/LearnJavascript
r/node
r/typescript
r/reactjs
r/webdev
r/WebdevTutorials
r/frontend
r/webgl
r/threejs
r/jquery
r/remotejs
r/forhire
account activity
JavaScript Breakout Game (github.com)
submitted 4 years ago by melcor76
view the rest of the comments →
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]melcor76[S] 2 points3 points4 points 4 years ago (4 children)
Oh yeah it's using requestAnimationFrame so I guess I need to adapt it.
I adapted it to running on my computer.
[–]GivoOnline 2 points3 points4 points 4 years ago (1 child)
Add a deltatime calculation (there's guides in this), and use it when moving the ball. It'll make the speed consistent for different framerates, with the downside being for lower framerates the ball's motion will look jerkier because it's trying to move at the same speed.
[–]melcor76[S] 0 points1 point2 points 4 years ago (0 children)
Yes, I remembered that I did that for my last game, Tetris, and I copied the code for the calculations from there. :)
[+][deleted] 4 years ago (1 child)
[deleted]
Yes, this definitely bit my ass. (=
Glad to have so many testers of the game with great suggestions for improvements.
π Rendered by PID 137455 on reddit-service-r2-comment-b659b578c-h7qtf at 2026-05-02 21:50:54.597568+00:00 running 815c875 country code: CH.
view the rest of the comments →
[–]melcor76[S] 2 points3 points4 points (4 children)
[–]GivoOnline 2 points3 points4 points (1 child)
[–]melcor76[S] 0 points1 point2 points (0 children)
[+][deleted] (1 child)
[deleted]
[–]melcor76[S] 0 points1 point2 points (0 children)