Skip to content

Conversation

MyreMylar
Copy link
Member

Hopefully, I didn't miss anything. Related to #1941

I can't see any good reason not to have these as properties. Sprite has never been an actual abstract base class, and python has always allowed you to just add a .image and .rect onto instances of Sprite without having to make a derived class.

By adding these as properties we gain hooks we can use on assignments for other refactoring later to boost performance.

I expect 90% of all sprite group using sprites derive from Sprite.

@MyreMylar MyreMylar requested a review from a team as a code owner February 25, 2023 21:00
@MyreMylar MyreMylar mentioned this pull request Feb 25, 2023
5 tasks
Copy link
Member

@oddbookworm oddbookworm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@MyreMylar MyreMylar added this to the 2.2 milestone Mar 2, 2023
Copy link
Member

@itzpr3d4t0r itzpr3d4t0r left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

@itzpr3d4t0r itzpr3d4t0r added the sprite pygame.sprite label Mar 11, 2023
Copy link
Member

@Starbuck5 Starbuck5 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems like a good idea, thanks.

@Starbuck5 Starbuck5 merged commit bc67e60 into main Mar 12, 2023
@Starbuck5 Starbuck5 deleted the sprite-image-rect-properties branch March 12, 2023 07:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
sprite pygame.sprite
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants