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:
objectThis 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