|
@@ -24,10 +24,10 @@ class Character(pygame.sprite.Sprite):
|
|
|
|
|
|
|
|
_predefined_attributes_allowed = [
|
|
_predefined_attributes_allowed = [
|
|
|
_('height'),
|
|
_('height'),
|
|
|
|
|
+ _('keys'),
|
|
|
_('position'),
|
|
_('position'),
|
|
|
_('speed'),
|
|
_('speed'),
|
|
|
_('width'),
|
|
_('width'),
|
|
|
- _('keys'),
|
|
|
|
|
]
|
|
]
|
|
|
|
|
|
|
|
def __init__(
|
|
def __init__(
|
|
@@ -322,7 +322,7 @@ class Character(pygame.sprite.Sprite):
|
|
|
Only declarated actions in _predefined_key_actions_allowed are allowed.
|
|
Only declarated actions in _predefined_key_actions_allowed are allowed.
|
|
|
|
|
|
|
|
Parameters:
|
|
Parameters:
|
|
|
- predefined_keys: the predefined keys with the associated action.
|
|
|
|
|
|
|
+ predefined_keys: The predefined keys with the associated action.
|
|
|
|
|
|
|
|
Examples:
|
|
Examples:
|
|
|
>>> ch = Character('protagonist.png')
|
|
>>> ch = Character('protagonist.png')
|
|
@@ -343,7 +343,7 @@ class Character(pygame.sprite.Sprite):
|
|
|
Set the character position as tuple. To use as separate coordinates call move_to().
|
|
Set the character position as tuple. To use as separate coordinates call move_to().
|
|
|
|
|
|
|
|
Parameters:
|
|
Parameters:
|
|
|
- position: a tuple with abscissa and ordinate coordinates
|
|
|
|
|
|
|
+ position: A tuple with abscissa and ordinate coordinates
|
|
|
key: Optional key to perform the action
|
|
key: Optional key to perform the action
|
|
|
|
|
|
|
|
Examples:
|
|
Examples:
|
|
@@ -363,7 +363,7 @@ class Character(pygame.sprite.Sprite):
|
|
|
Set the character speed.
|
|
Set the character speed.
|
|
|
|
|
|
|
|
Parameters:
|
|
Parameters:
|
|
|
- speed: the character speed
|
|
|
|
|
|
|
+ speed: The character speed
|
|
|
|
|
|
|
|
Examples:
|
|
Examples:
|
|
|
>>> ch = Character('protagonist.png')
|
|
>>> ch = Character('protagonist.png')
|