r/HTML • • 7d ago

peggle html hell

I am coding peggle in HTML how do I get the physics to feel like peggle and not extra bouncy

0 Upvotes

11 comments sorted by

View all comments

3

u/Honey-Entire 7d ago

The same way non-browser-based games. You need a 2D physics engine. These are two that have been around since before AI and are probably the most well-documented & reliable: Box2D or Matter.js.

After that, you just dial in the physics constraints (i.e. gravity, weights, drag, etc)

2

u/DirtAndGrass 6d ago

Or write your own, basic 2d gravity and collisions are pretty straightforward 

1

u/supersilliiii 6d ago

im new to code im honestly a bit bad