check_for_collision: Trigger spritelist init if needed#2662
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR ensures that lazy spritelists are initialized when required during GPU collision checks. Key changes include:
- Adding a new test to confirm spritelist initialization on GPU collision.
- Updating the geometry property in SpriteList to call initialize() automatically.
- Adjusting the collision module to use the geometry property instead of a direct _geometry attribute.
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| tests/unit/sprite/test_sprite_collision.py | Adds a new test to verify initialization of a lazy spritelist. |
| arcade/sprite_list/sprite_list.py | Changes the geometry property check to call initialize() if needed. |
| arcade/sprite_list/collision.py | Uses the geometry property for collision transform instead of _geometry. |
Comments suppressed due to low confidence (1)
tests/unit/sprite/test_sprite_collision.py:320
- Typo in the docstring: 'his' should be corrected to 'is'.
This ensures that check_for_collision_with_list() will trigger a spritelist initialization if his is not done yet.
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.
Initialize lazy spritelists if needed when gpu collision is selected
#2661