Hud

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

class hud.HUD(escape_room=0, hero_loot=0, hero_loot_goal=0, key_counter=0, potion_counter=0, room_id=0, defeated_enemy_counter=0, defeated_enemy_counter_goal=0, action='')

Bases: object

This class describes the representation of the HUD

create_alpha_surface(text_surface, alpha_value, is_exit)

Creates an alpha surface for HUD id representation

Parameters

param text_surface:

Text Surface

type text_surface:

pygame Surface

param alpha_value:

Alpha value for the Surface

type alpha_value:

int

Returns

returns:

A Surface for the room id in HUD

rtype:

pygame Surface

render(screen)

Rendering all HUD Object elements on the screen using a tile set

Parameters

param screen:

Screen where dungeon_gui runs

type screen:

pygame Surface

update_action(action)

Updates action attribute and its HUD representation

Parameters

param action:

Hero action performed

type action:

str

update_defeated_enemy_counter(defeated_enemy_counter)

Updates defeated_enemy_counter attribute and its HUD representation

Parameters

param defeated_enemy_counter:

Number of defeated enemies

type defeated_enemy_counter:

int

update_escape_room()

Updates escape_room attribute and its HUD representation

update_hero_loot(hero_loot)

Updates hero_loot attribute and its HUD representation

Parameters

param hero_loot:

Hero loot value

type hero_loot:

int

update_id(new_id, is_exit)

Updates id attribute and its HUD representation

Parameters

param new_id:

Number of room visited

type new_id:

int

param is_exit:

Boolean that indicates if the room is an exit

type is_exit:

bool

update_keys(keys)

Updates keys attribute and its HUD representation

Parameters

param keys:

Number of keys owned

type keys:

int

update_potions(potions)

Updates potions attribute and its HUD representation

Parameters

param potions:

Number of potions owned

type potions:

int