all repos — Legends-RPG @ 5dc45a6a3236bb0f37cda02f65aecb54b0e7212e

A fantasy mini-RPG built with Python and Pygame.

data/states/house/house.py (view raw)

 1"""This is the house on the lower left hand
 2corner of the town.  Most of its functionality is inherited
 3from the level_state.py module.  Most of the level data is contained
 4in the tilemap .txt files in this state's directory.  Essentially the
 5only purpose of house.py is to assign dialogue to each sprite.
 6"""
 7
 8
 9from .. import level_state
10from ... import constants as c
11
12class House(level_state.LevelState):
13    def __init__(self):
14        super(House, self).__init__()
15        self.name = c.HOUSE
16        self.map_width = 25
17        self.map_height = 19
18
19    def set_sprite_dialogue(self):
20        """Sets unique dialogue for each sprite"""
21        for sprite in self.sprites:
22            if sprite.location == [14, 6]:
23                sprite.dialogue = ["I am very sick.   cough... cough...",
24                                   "Only an ELIXIR can help me.",
25                                   "Please go to my brother and obtain one for me.",
26                                   "He lives in a house on the NorthEast shores.",
27                                   "I will be forever in your debt."]