Gravity Collision Simulator

Gravity Collision Simulator Used AI

8 devlogs
5h 20m
•  Ship certified
Created by advayc

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

Timeline

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

Update attachment

remade deploy site and fix to get it working online

Update attachment

Ball Simulator Web Devlog

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:

  1. Audio Removal:

    • All pygame.mixer and sound segment code was removed for web compatibility.
    • No audio files are loaded or referenced.
  2. Animation Styles:

    • Introduced a STYLES dictionary to configure each style's features.
    • Styles include: Rainbow (color cycling), Neon Pulse (pulsing effect), Particle Trail (particles and trail), Classic (solid color).
    • Ball class updated to support color cycling, pulsing, trails, and particles based on current style.
  3. UI for Style Selection:

    • Added on-screen buttons for switching styles.
    • Buttons are clickable and touch-friendly, with hover and active feedback.
    • UI is always visible and responsive to window resizing.
  4. Physics Consistency:

    • All styles now use the same gravity, collision, and growth logic.
    • Ensured the ball is always visible and behaves consistently in every style.
    • Fixed issues where the ball was not visible in some styles.
  5. Web Deployment Improvements:

    • Added browser detection and window resize handling for web.
    • Improved event loop and timing for Pygbag compatibility.
    • Created a deploy.sh script for easy local testing and web builds.
    • Updated .gitignore for Python, Pygbag, and web artifacts.
    • Added index.html for web embedding with loading screen.
    • README.md updated with clear web deployment instructions.
  6. GitHub Actions Workflow:

    • (Pending) Will update deploy.yml to ensure correct build and publish to gh-pages.

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

Update attachment

Ship 1

1 payout of shell 43.0 shells

advayc

25 days ago

advayc Covers 5 devlogs and 3h

FINAL MAKE BANNER

Update attachment

Spent time working on fixing the sound, unsuccessful

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

Update attachment