Skip to content

Render explosion particles after the asteroid that spawned them dies (SLOP-451) - #2

Open
tosfos wants to merge 1 commit into
masterfrom
SLOP-451-explosion-particles-render
Open

Render explosion particles after the asteroid that spawned them dies (SLOP-451)#2
tosfos wants to merge 1 commit into
masterfrom
SLOP-451-explosion-particles-render

Conversation

@tosfos

@tosfos tosfos commented Aug 23, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Explosion particles were stored on each asteroid's own particle system and only drawn from Asteroid.draw(), but a destroyed asteroid is removed from the game state in the same collision tick as explode(). Result: the advertised explosion effect was dead code - asteroids just vanished when shot.
  • Destroyed asteroids now hand their still-alive particle system to a game-level explosions list, which keeps updating and drawing it until all particles fade out (and clears on restart).

Evidence

Verified empirically with a headless harness driving the real game classes (pygame-ce 2.5.8, Python 3.14):

  • Before: destroyed asteroid received 0 draw calls across 31 subsequent frames; its 60 explosion particles could never be rendered.
  • After: the detached system is tracked in game state, drawn every frame (124 draw calls over 31 frames), with particles decaying as intended.

Test plan

  • Harness: detached explosion system updates/draws post-impact until empty
  • python -m py_compile on all modules

Explosion particles lived on each asteroid's own particle system and were
only drawn via Asteroid.draw(). Since a destroyed asteroid is removed from
the game state in the same tick as explode(), its explosion could never be
seen - asteroids simply vanished when shot, despite the effect promised in
the README.

Destroyed asteroids now hand their still-alive particle systems to a
game-level explosions list which keeps updating and drawing them until they
fade out, and is cleared on restart.

Fixes SLOP-451

Co-authored-by: Cursor <cursoragent@cursor.com>
@coderabbitai

coderabbitai Bot commented Aug 23, 2026

Copy link
Copy Markdown

Important

  • 🔍 Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 93a05854-9b18-45d7-bcfc-fe09b581215b


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant