NPC

class gamelib.Characters.NPC(**kwargs)

A class that represent a non playable character controlled by the computer. For the NPC to be successfully managed by the Game, you need to set an actuator.

None of the parameters are mandatory, however it is advised to make good use of some of them (like type or name) for game design purpose.

In addition to its own member variables, this class inherits all members from:
Parameters:actuator (gamelib.Actuators.Actuator) – An actuator, it can be any class but it need to implement gamelib.Actuator.Actuator.

Example:

mynpc = NPC(name='Idiot McStupid', type='dumb_enemy')
mynpc.step = 1
mynpc.actuator = RandomActuator()
__init__(**kwargs)

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

Methods

__init__(**kwargs) Initialize self.
can_move() Movable implements can_move().
debug_info() Return a string with the list of the attributes and their current value.
display() Print the model WITHOUT carriage return.
has_inventory() Define if the NPC has an inventory.
overlappable() Define if the NPC is overlappable.
pickable() Define if the NPC is pickable.
size() This is a virtual method that must be implemented in deriving class.
store_position(row, column) Store the BoardItem position for self access.