Created
October 28, 2015 17:36
-
-
Save bitcraft/cbb6dba134fcd6edd96c to your computer and use it in GitHub Desktop.
This file contains 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
def set_position(self, x, y): | |
"""Set the X and Y coordinates of the sprite simultaneously. | |
:Parameters: | |
`x` : int | |
X coordinate of the sprite. | |
`y` : int | |
Y coordinate of the sprite. | |
""" | |
self.position = x, y | |
@property | |
def position(self): | |
return self._x, self._y | |
@position.setter | |
def position(self, *coords): | |
self._x, self._y = coords[0] | |
self._update_position() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment