A physics-based ball simulation built with Python and Pygame, with realistic gravity and collision detection. Aims to simulate satisfying ball drop clips seen on tiktok and instagram, but with python
No followers yet
Once you ship this you can't edit the description of the project, but you'll be able to add more devlogs and re-ship it as you add new features!
Technical Details Included:
Physics calculations (gravity: 0.7, initial velocity: 12)
Color system implementation (HSV conversion, timer increments)
Web compatibility patterns (async/await, event handling)
Git commands used for state management
PyGBag deployment configuration
Problem-Solution Format:
Custom template issues → Default PyGBag templates
Script loading failures → Configuration cleanup
Git state management → Hard resets to working commits
now the project is fixed and uploaded
Date: 2025-07-22
Major Goals:
- Remove all audio dependencies for web compatibility
- Add multiple animation styles (Rainbow, Neon Pulse, Particle Trail, Classic)
- Ensure all styles work and are visible on web (Pygbag)
- Add UI for style selection (touch and mouse friendly)
- Improve deployment workflow for GitHub Pages
Key Changes:
Audio Removal:
Animation Styles:
STYLES
dictionary to configure each style's features.UI for Style Selection:
Physics Consistency:
Web Deployment Improvements:
GitHub Actions Workflow:
Testing:
- Simulator tested locally and in browser (via Pygbag)
- All styles confirmed working: ball is always visible, physics are consistent
- UI works with both mouse and touch
- Web build loads and runs on desktop and mobile
Next Steps:
- Finalize and test GitHub Actions deploy.yml for automated web publishing
- Consider adding more styles or user-tunable parameters
- Gather user feedback for further improvements
on collision it plays part of a song
optimized pygame mixer for mp3 playback
removed docstring comments
improved segment playback timing and control
added better error handling for audio loading
fixed sequential segment playing on collisions
converted simulation to 1080p video output
implement rainbow color effect for ball visualization
add smooth growth mechanism with accumulator for gradual size increase
optimizeed physics with proper collision detection and reflection
removed energy damping for consistent ball movement
added automatic simulation end when ball reaches boundary size
adjusted gravity and initial velocity for better visual effect
Created Inner and Outer Circle, which are the boundaries for the ball to drop
Created Ball class, with gravity