|
|
@@ -41,6 +41,7 @@ class Character(pygame.sprite.Sprite):
|
|
|
]
|
|
|
|
|
|
_predefined_attributes_allowed = [
|
|
|
+ _('collidable'),
|
|
|
_('height'),
|
|
|
_('keys'),
|
|
|
_('position'),
|
|
|
@@ -427,6 +428,18 @@ class Character(pygame.sprite.Sprite):
|
|
|
self._original_image, self.angle, self.scale_factor
|
|
|
)
|
|
|
|
|
|
+ def set_collidable(self, collidable: bool = True):
|
|
|
+ """
|
|
|
+ Set the character collidable.
|
|
|
+
|
|
|
+ Parameters:
|
|
|
+ collidable: True if it is collidable, False otherwise.
|
|
|
+ """
|
|
|
+ if not isinstance(collidable, bool):
|
|
|
+ raise TypeError(_('The collidable argument must be a boolean.'))
|
|
|
+
|
|
|
+ self.collidable = collidable
|
|
|
+
|
|
|
def set_height(self, height: int):
|
|
|
"""
|
|
|
Set the character height.
|