pygamelib.board_items.ComplexPlayer

class pygamelib.board_items.ComplexPlayer(**kwargs)

New in version 1.2.0.

A complex player is nothing more than a Player mashed with a BoardComplexItem.

It supports all parameters of both with inheritance going first to Player and second to BoardComplexItem.

The main interest is of course the multiple cell representation and the Sprites support.

Example:

player = ComplexPlayer(
        name='Mighty Wizard',
        sprite=sprite_collection['wizard_idle']
    )
__init__(**kwargs)

Initialize self. See help(type(self)) for accurate signature.

Methods

__init__(**kwargs) Initialize self.
can_move() Movable implements can_move().
collides_with(other) Tells if this item collides with another item.
column Convenience method to get the current stored column of the item.
debug_info() Return a string with the list of the attributes and their current value.
display() Print the model WITHOUT carriage return.
distance_to(other) Calculates the distance with an item.
has_inventory() This method returns True (a player has an inventory).
height Convenience method to get the height of the item.
inventory_space() This is a virtual method that must be implemented in deriving class.
item(row, column) Return the item at the row, column position if it is within the item’s boundaries.
overlappable() This method returns false (a player cannot be overlapped).
pickable() This method returns False (a player is obviously not pickable).
position_as_vector() Returns the current item position as a Vector2D
row Convenience method to get the current stored row of the item.
store_position(row, column) Store the BoardItem position for self access.
update_sprite() Update the complex item with the current sprite.
width Convenience method to get the width of the item.