Player

This module is part of the dungeon_gui package, for the graphical representation of the dungeon

class Player.Player(current_health=100, max_health=100, pos_x=9.4, pos_y=8, character_tileset=<Surface(16x16x32 SW)>, weapon=None, potion=None)

Bases: object

This class describes the representation of the Hero Player

collect_potion(potion)

Calls the function to collect the potion

Parameters

param potion:

Potion object

type potion:

Potion

get_damage(damage)

Manages the damage taken by the hero, updating his health

Parameters

param damage:

Damage value

type damage:

int

get_heal()

Manages the hero’s health, when healing himself

Parameters

param heal:

Heal value

type heal:

int

render_player(screen, scale_factor)

Rendering of the Player Object on the screen using a tile set

Parameters

param screen:

Screen where dungeon_gui runs

type screen:

pygame Surface

param scale_factor:

Object scale factor

type scale_factor:

int

update_health(health)

Updates current_health attribute and health_bar

Parameters

param health:

Hero healt value

type health:

int

update_weapon(new_damage)

Calls the function to update the weapon’s damage

Parameters

param new_damage:

Weapon damage value

type new_damage:

int