Log In  


I feel like I make one of these every year or so, but it's a rudimentary physics engine for bouncy balls

Cart #58007 | 2018-10-16 | Code ▽ | Embed ▽ | License: CC4-BY-NC-SA
1

seems like randomly the balls are too fast to see, just restarting the cart seems to fix it
(added particle count)
old version:


1


here's an update to improve performance (move all of the Entity loops into the same single loop) and fix a couple things

still not sure why the balls will sometimes stop in midair

Cart #58072 | 2018-10-18 | Code ▽ | Embed ▽ | License: CC4-BY-NC-SA


Wow, really convincing and the code is so short, always amazes me !


1

Hi! I really like this demo cart. What is vx and vy and how (and why) is it different from ax and ay? I'm wondering since I want to borrow some of the code for my own game


Beanos123 if you see this message: vx and vy is velocity, ax ay is acceleration, i think this is probably overkill but that was the way i did it at the time. nx and ny is "next x position" and the same for y pos, i use it for collision detection with the walls, in oadd r is the bounciness ratio of that ball, and c is the color



[Please log in to post a comment]