-
-
Notifications
You must be signed in to change notification settings - Fork 98
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add rotatability to sprites. #214
Conversation
Assuming it passes Travis, this should be ready to go. |
|
||
@rotation.setter | ||
def rotation(self, value): | ||
self._rotation = value % 360 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This can still be negative; should this use the same convention as ppb-vector
and have -180 < _rotation <= 180
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In the case of this interface, dunno if it matters. The tests have some negative rotation and it gives the equivalent positive rotation, which is a reasonable result, but if both you and @astronouth7303 feel like I should port that over here, I will.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@pathunstrom I don't think it's much of an issue either way, I just wanted to check that was intentional.
@@ -140,7 +140,34 @@ def _attribute_gate(self, attribute, bad_sides): | |||
raise AttributeError(message) | |||
|
|||
|
|||
class BaseSprite(EventMixin): | |||
class Rotatable: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Rotatable
sounds weird to me, but I'm a silly non-native speaker. shrugs
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Native speaker, sounds weird to me, too, but lots of mixins are named based on their capabilities.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
-able is approximately the right convention, but it leads to lots of weird words.
I would also accept CanBe*? Also weird.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So like CanBeRotated
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Or just CanRotate
? In any case, I don't think Rotatable
is a big issue, I was just very confused whether there was a typo, or it was just weird, or I was just bad at English.
Co-Authored-By: pathunstrom <pathunstrom@gmail.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should probably add transformed resource caching.
Otherwise, looks good.
First pass at this. Will still need to add the functionality to rotate the images themselves.
Closes #142