Skip to content

mike-s-zaugg/2DPhysicEngine

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Bouncing Balls Physics Simulation

A clean and simple HTML Canvas physics simulation written in pure JavaScript.
Multiple balls fall with gravity, collide realistically, slide with friction, display their velocity as arrows, and increment a live collision counter.

Showcase

image

Features

  • Gravity-based movement
  • Realistic elastic collisions (with friction and impulse)
  • Velocity arrow visualization
  • Live collision counter
  • Ball spawning system
  • Reset function
  • 100% Vanilla JavaScript, no external libraries

Controls

  • spawnBall() – spawns a new ball
  • resetAll() – clears all balls and resets the collision counter

Purpose

Useful for learning and experimenting with:

  • 2D vector math
  • Collision detection and resolution
  • Impulse and friction simulation
  • Canvas rendering
  • Basic game-physics systems

About

A simple JavaScript physics demo showcasing bouncing balls with gravity, realistic collision response, friction, and a live collision counter. Includes arrow-vectors showing each ball’s velocity, a reset function, and dynamic ball spawning. Built on HTML Canvas with no external libraries.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors