{"repo":"MTrajK/bouncing-balls","free":true,"listed":false,"github":"https://github.com/MTrajK/bouncing-balls","clone":"git clone https://github.com/MTrajK/bouncing-balls.git","description":"Bouncing balls simulation using plain JavaScript","language":"JavaScript","stars":114,"topics":["bouncing-balls","physics-simulation","javascript","game-development","canvas"],"license":"MIT","category":"game-templates","readme_excerpt":"Bouncing Balls Simple bouncing balls simulation using plain JavaScript. Drawing in HTML Canvas, also plain CSS is used. (without third-part frameworks/code) Try it here Description - With a mouse click on the canvas a new ball is created, aim with holding the mouse down and moving it (drag the mouse further from the start point for greater speed), shoot the new ball with releasing the mouse button. (also touch screens/devices are supported, the same rules are used for touch events) - The canvas is updated (redrawn) 60 times in 1 second. (60 fps) - The canvas is responsive, with help from CSS media queries. - Because of that, the whole physics engine (all maths and logics inside) works with local coordinates/units. The local width is always 100 local units, and the height is always 66.6667 local units. (because the canvas ratio is 3:2) - The simulation is not a 100% real-world simulation, because there are many more factors for moving/colliding in the real world like the ball spinning, the softness of balls, the type of walls, even the weather, and sound waves have influence in the real world. - More description of the physics you can find inside the code, for example, when the balls collide these formulas are used, link. - Known issue: In \"vertical\" space/direction when the bottom is full with balls (when there is no space for a new ball) adding a new ball will make all balls go crazy (jumping randomly). This is because the balls will always collide and won't lose energy from","default_branch":null,"files":null,"tree":[],"storefront":"/r/MTrajK","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/MTrajK/bouncing-balls/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}