Implement individual hitboxes for asteroids - #8
Open
wannerdev wants to merge 2 commits into
Open
Conversation
added 2 commits
October 19, 2025 05:30
- Removed single hitbox from AsteroidSwarm parent entity - Added individual HitBox component to each Asteroid child - Each asteroid now has radius of 2.5 for precise collision detection - Added Level component to individual asteroids - Improves collision accuracy for asteroid-satellite interactions - Fixes issue where entire swarm was treated as single collision object
- Added Attractee component so asteroids are affected by gravity - Added GravityForce component for force calculations - Added Mass component (0.1) for physics interactions - Added necessary imports for physics components - Asteroids now properly render and move with gravity - Fixes issue where asteroids disappeared after PR #8
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Fixes collision detection for asteroids by giving each individual asteroid its own hitbox instead of treating the entire swarm as a single collision object.
Changes
HitBoxfromAsteroidSwarmparent entityHitBoxcomponent to eachAsteroidchild entityLevelcomponent to individual asteroids for proper collision handlingBug Details
Before: The entire asteroid swarm had one hitbox (radius 14.0) at the swarm center, making collision detection imprecise and treating all asteroids as a single object.
After: Each asteroid has its own hitbox (radius 2.5) at its actual position, enabling accurate per-asteroid collision detection.
Benefits
Technical Details
Testing
Related Issue
Fixes: Bug - Asteroids should have individual hitboxes