Skip to content

Instantly share code, notes, and snippets.

@bitcraft
Created October 28, 2015 17:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bitcraft/cbb6dba134fcd6edd96c to your computer and use it in GitHub Desktop.
Save bitcraft/cbb6dba134fcd6edd96c to your computer and use it in GitHub Desktop.
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