Room

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

class Room.Room(id, key=None, loot=None, enemy=None, weapon=None, potion=None, width=160, height=176, has_door=False, is_exit=False, x=0, y=0)

Bases: object

This class describes the representation of the Room

collect_key()

Calls the function to set key’s collected attribute

collect_potion()

Calls the function to set potion’s collected attribute

collect_treasure()

Calls the function to set treasure’s collected attribute

collect_weapon()

Calls the function to set weapon’s collected attribute

defeat_enemy()

Calls the function to set enemy’s killed attribute

generate_tile_mapping()

Generates a tile mapping for the room representation

Returns

returns:

A dict containing the tile mapping

rtype:

dict

render(screen)

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

Parameters

param screen:

Screen where dungeon_gui runs

type screen:

pygame Surface

set_enemy(enemy)

Sets the value of enemy

Parameters

param enemy:

Enemy Object to set

type enemy:

Enemy

set_key(key)

Sets the value of key

Parameters

param key:

Key Object to set

type key:

Key

set_loot(loot)

Sets the value of loot

Parameters

param loot:

Loot Object to set

type loot:

Loot

set_potion(potion)

Sets the value of potion

Parameters

param potion:

Potion Object to set

type potion:

Potion

set_weapon(weapon)

Sets the value of weapon

Parameters

param weapon:

Weapon Object to set

type weapon:

Weapon