Announcement
Collapse
No announcement yet.
User Profile
Collapse
-
What should I do Before I give up programming?
I'm in the verge of giving up programming and wondering what could I do before I give up to make sure I did what everyone did.
I've a bachelors degree in computer science. I didn't do it as well as I'd have liked to do, but that degree has gave me familiarity with most terms used in basic...
-
How to reflect the ball at an angle?
Here's the full code:
When a ball collides with bat or walls, I want the ball to be reflected with an angle, how do I do it?
I suspect there's lots of physics to it. So, should I stop this project here? I'd have to probably build a part of...
-
-
I must tell why my confusion came here:
Earlier in the code, we’ve done this:
Code://head of snake let snakeArr = [ { x: 13, y: 15 } ]
Here x,y means the grid row 13, grid column 15. That is why I’m confused....
Leave a comment:
-
input Direction confusion in snake game javascript
Here's the full code:
This is the code that I'm interested in:
Code:window.addEventListener("keydown", e => { inputDir = { x: 0, y: 1 }; moveSound.play(); switch (e.key) { case "ArrowUp":
-
This figure from this blog helped me clear my concepts related to this.
Source: https://nainacodes.com/blog/understa...-in-javascript
1) Initially, window.rAF is passed to call stack.
2) By definition, rAF waits till next repaint of...
Leave a comment:
-
My confusion has been added up. Here's a new post.
My confusion:
"If condition" should never be checked on this code. Because:
1) window.requestAnimationFrame(main): It calls main function.
2) At the very first line of main function, it again calls main...
Leave a comment:
-
What happens when return is executed in this code?
I'm currently watching tutorials to build projects as I'm still not in a phase where I can carve a project that I want all on my own.
Currently, working on a snake game.
Code:let speed = 2; let lastPaintTime = 0; //Game functions function main(ctime) { window.requestAnimationFrame(main);
No activity results to display
Show More
Leave a comment: