all repos — Legends-RPG @ 9ee373a472b1ac434cf268cdcf3875ada4c57b29

A fantasy mini-RPG built with Python and Pygame.

Items bought in store are now added to the game's data.  Added a Demon and another female villager.
Justin Armstrong justinmeister@gmail.com
Sun, 23 Mar 2014 22:42:59 -0700
commit

9ee373a472b1ac434cf268cdcf3875ada4c57b29

parent

1f20be8e2b5a053cf1399827b2df12350d0d0fc3

M data/components/person.pydata/components/person.py

@@ -1,4 +1,3 @@

-__author__ = 'justinarmstrong' import math, random import pygame as pg from .. import setup

@@ -22,7 +21,6 @@ self.direction = direction

self.image_list = self.animation_dict[self.direction] self.image = self.image_list[self.index] self.rect = self.image.get_rect(left=x, top=y) - #self.old_rect = self.rect self.state_dict = self.create_state_dict() self.vector_dict = self.create_vector_dict() self.x_vel = 0

@@ -327,6 +325,13 @@ super(FemaleVillager, self).__init__('femalevillager', x, y)

self.index = 1 +class FemaleVillager2(Person): + """A second female person for town""" + def __init__(self, x, y): + super(FemaleVillager2, self).__init__('femvillager2', x, y) + self.index = 1 + + class MaleVillager(Person): """Male Person for town"""

@@ -338,6 +343,12 @@ class King(Person):

"""King of the town""" def __init__(self, x, y, direction='down', state='resting'): super(King, self).__init__('king', x, y, direction, state) + + +class Devil(Person): + """Devil-like villager""" + def __init__(self, x, y, direction='down', state='autoresting'): + super(Devil, self).__init__('devil', x, y, direction, state) class Well(pg.sprite.Sprite):
M data/components/textbox.pydata/components/textbox.py

@@ -183,7 +183,7 @@ """Checks if sprite has an item to give to the player"""

item = self.talking_sprite.item if item: if 'gold' in item: - self.game_data['player items']['gold'] += item['gold'] + self.game_data['player inventory']['gold'] += item['gold'] self.talking_sprite.item = None if self.talking_sprite.name == 'king': self.game_data['king item'] = None
A data/shopgui.py

@@ -0,0 +1,262 @@

+""" +This class controls the textbox GUI for any shop state. +A Gui object is created and updated by the shop state. +""" + +import pygame as pg +from . import setup +from . components import textbox +from . import constants as c + + +class Gui(object): + """Class that controls the GUI of the shop state""" + def __init__(self, level): + self.level = level + self.player_inventory = level.game_data['player inventory'] + self.name = level.name + self.state = 'dialogue' + self.font = pg.font.Font(setup.FONTS['Fixedsys500c'], 22) + self.index = 0 + self.timer = 0.0 + self.item = level.item + self.dialogue = level.dialogue + self.accept_dialogue = level.accept_dialogue + self.arrow = textbox.NextArrow() + self.selection_arrow = textbox.NextArrow() + self.arrow_pos1 = (50, 485) + self.arrow_pos2 = (50, 535) + self.selection_arrow.rect.topleft = self.arrow_pos1 + self.dialogue_box = self.make_dialogue_box(self.dialogue, self.index) + self.gold_box = self.make_gold_box() + self.selection_box = self.make_selection_box() + self.state_dict = self.make_state_dict() + + + def make_dialogue_box(self, dialogue_list, index): + """Make the sprite that controls the dialogue""" + image = setup.GFX['dialoguebox'] + rect = image.get_rect() + surface = pg.Surface(rect.size) + surface.set_colorkey(c.BLACK) + surface.blit(image, rect) + dialogue = self.font.render(dialogue_list[index], + True, + c.NEAR_BLACK) + dialogue_rect = dialogue.get_rect(left=50, top=50) + surface.blit(dialogue, dialogue_rect) + sprite = pg.sprite.Sprite() + sprite.image = surface + sprite.rect = rect + self.check_to_draw_arrow(sprite) + + return sprite + + + def make_selection_box(self): + """Make the box for the player to select options""" + image = setup.GFX['shopbox'] + rect = image.get_rect(bottom=608) + + surface = pg.Surface(rect.size) + surface.set_colorkey(c.BLACK) + surface.blit(image, (0, 0)) + + if self.state == 'select': + choices = self.item['dialogue'] + elif self.state == 'confirm': + choices = ['Yes', + 'No'] + else: + choices = ['Not', + 'assigned'] + choice1 = self.font.render(choices[0], True, c.NEAR_BLACK) + choice1_rect = choice1.get_rect(x=200, y=25) + choice2 = self.font.render(choices[1], True, c.NEAR_BLACK) + choice2_rect = choice2.get_rect(x=200, y=75) + surface.blit(choice1, choice1_rect) + surface.blit(choice2, choice2_rect) + sprite = pg.sprite.Sprite() + sprite.image = surface + sprite.rect = rect + + return sprite + + + + def check_to_draw_arrow(self, sprite): + """Blink arrow if more text needs to be read""" + if self.index < len(self.dialogue) - 1: + sprite.image.blit(self.arrow.image, self.arrow.rect) + + + def make_gold_box(self): + """Make the box to display total gold""" + image = setup.GFX['goldbox'] + rect = image.get_rect(bottom=608, right=800) + + surface = pg.Surface(rect.size) + surface.set_colorkey(c.BLACK) + surface.blit(image, (0, 0)) + gold = self.player_inventory['gold'] + text = 'Gold: ' + str(gold) + text_render = self.font.render(text, True, c.NEAR_BLACK) + text_rect = text_render.get_rect(x=80, y=60) + + surface.blit(text_render, text_rect) + + sprite = pg.sprite.Sprite() + sprite.image = surface + sprite.rect = rect + + return sprite + + + + def make_state_dict(self): + """Make the state dictionary for the GUI behavior""" + state_dict = {'dialogue': self.control_dialogue, + 'select': self.make_selection, + 'confirm': self.confirm_selection, + 'reject': self.reject_insufficient_gold, + 'accept': self.accept_purchase, + 'hasitem': self.has_item} + + return state_dict + + + def control_dialogue(self, keys, current_time): + """Control the dialogue boxes""" + self.dialogue_box = self.make_dialogue_box(self.dialogue, self.index) + + if self.index < (len(self.dialogue) - 1): + if keys[pg.K_SPACE]: + self.index += 1 + + elif self.index == (len(self.dialogue) - 1): + self.state = 'select' + self.timer = current_time + + + def make_selection(self, keys, current_time): + """Control the selection""" + self.dialogue_box = self.make_dialogue_box(self.dialogue, self.index) + self.selection_box = self.make_selection_box() + self.gold_box = self.make_gold_box() + + if keys[pg.K_DOWN]: + self.selection_arrow.rect.topleft = self.arrow_pos2 + elif keys[pg.K_UP]: + self.selection_arrow.rect.topleft = self.arrow_pos1 + elif keys[pg.K_SPACE] and (current_time - self.timer) > 200: + if self.selection_arrow.rect.topleft == self.arrow_pos2: + self.level.done = True + self.level.game_data['last direction'] = 'down' + elif self.selection_arrow.rect.topleft == self.arrow_pos1: + self.state = 'confirm' + self.timer = current_time + + + + def confirm_selection(self, keys, current_time): + """Confirm selection state for GUI""" + dialogue = ['Are you sure?'] + self.selection_box = self.make_selection_box() + self.gold_box = self.make_gold_box() + self.dialogue_box = self.make_dialogue_box(dialogue, 0) + + if keys[pg.K_DOWN]: + self.selection_arrow.rect.topleft = self.arrow_pos2 + elif keys[pg.K_UP]: + self.selection_arrow.rect.topleft = self.arrow_pos1 + elif keys[pg.K_SPACE] and (current_time - self.timer) > 200: + if self.selection_arrow.rect.topleft == self.arrow_pos1: + self.buy_item() + else: + self.state = 'select' + self.timer = current_time + self.selection_arrow.rect.topleft = self.arrow_pos1 + + + def buy_item(self): + """Attempt to allow player to purchase item""" + self.player_inventory['gold'] -= self.item['price'] + + if self.player_inventory['gold'] < 0: + self.player_inventory['gold'] += self.item['price'] + self.state = 'reject' + else: + if (self.item['type'] == 'Fire Spell' and + 'Fire Spell' in self.player_inventory): + self.state = 'hasitem' + self.player_inventory['gold'] += self.item['price'] + else: + self.state = 'accept' + self.add_player_item(self.item) + + + def reject_insufficient_gold(self, keys, current_time): + """Reject player selection if they do not have enough gold""" + dialogue = ["You don't have enough gold!"] + self.dialogue_box = self.make_dialogue_box(dialogue, 0) + + if keys[pg.K_SPACE] and (current_time - self.timer) > 200: + self.state = 'select' + self.timer = current_time + self.selection_arrow.rect.topleft = self.arrow_pos1 + + + def accept_purchase(self, keys, current_time): + """Accept purchase and confirm with message""" + self.dialogue_box = self.make_dialogue_box(self.accept_dialogue, 0) + self.gold_box = self.make_gold_box() + + if keys[pg.K_SPACE] and (current_time - self.timer) > 200: + self.state = 'select' + self.timer = current_time + self.selection_arrow.rect.topleft = self.arrow_pos1 + + + def has_item(self, keys, current_time): + """Tell player he has item already""" + dialogue = ["You have that item already."] + self.dialogue_box = self.make_dialogue_box(dialogue, 0) + + if keys[pg.K_SPACE] and (current_time - self.timer) > 200: + self.state = 'select' + self.timer = current_time + self.selection_arrow.rect.topleft = self.arrow_pos1 + + + def add_player_item(self, item): + """Add item to player's inventory""" + item_type = item['type'] + quantity = item['quantity'] + player_item = self.level.game_data['player inventory'] + + if item_type in player_item: + player_item[item_type] += quantity + elif quantity > 0: + player_item[item_type] = quantity + + + + def update(self, keys, current_time): + """Updates the shop GUI""" + state_function = self.state_dict[self.state] + state_function(keys, current_time) + + + def draw(self, surface): + """Draw GUI to level surface""" + state_list1 = ['dialogue', 'reject', 'accept', 'hasitem'] + state_list2 = ['select', 'confirm'] + + if self.state in state_list1: + surface.blit(self.dialogue_box.image, self.dialogue_box.rect) + surface.blit(self.gold_box.image, self.gold_box.rect) + elif self.state in state_list2: + surface.blit(self.dialogue_box.image, self.dialogue_box.rect) + surface.blit(self.selection_box.image, self.selection_box.rect) + surface.blit(self.selection_arrow.image, self.selection_arrow.rect) + surface.blit(self.gold_box.image, self.gold_box.rect)
M data/states/level_state.pydata/states/level_state.py

@@ -16,12 +16,16 @@

class LevelState(tools._State): def __init__(self): super(LevelState, self).__init__() + self.name = None + self.map_width = None + self.map_height = None def startup(self, current_time, game_data): """Called when the State object is created""" self.game_data = game_data + print(game_data['player inventory']) self.current_time = current_time self.state = 'normal' self.town_map = tm.make_level_map(self.name,
M data/states/shop.pydata/states/shop.py

@@ -2,238 +2,20 @@ """

This class is the parent class of all shop states. This includes weapon, armour, magic and potion shops. It also includes the inn. These states are scaled -twice as big as a level state. +twice as big as a level state. The self.gui controls +all the textboxes. """ + import copy import pygame as pg -from .. import tools, setup +from .. import tools, setup, shopgui from .. import constants as c -from .. components import textbox, person - - -class Gui(object): - """Class that controls the GUI of the shop state""" - def __init__(self, level): - self.level = level - self.name = level.name - self.state = 'dialogue' - self.font = pg.font.Font(setup.FONTS['Fixedsys500c'], 22) - self.index = 0 - self.timer = 0.0 - self.items = level.items - self.dialogue = level.dialogue - self.arrow = textbox.NextArrow() - self.selection_arrow = textbox.NextArrow() - self.arrow_pos1 = (50, 485) - self.arrow_pos2 = (50, 535) - self.selection_arrow.rect.topleft = self.arrow_pos1 - self.dialogue_box = self.make_dialogue_box(self.dialogue, self.index) - self.gold_box = self.make_gold_box() - self.selection_box = self.make_selection_box() - self.state_dict = self.make_state_dict() - - - def make_dialogue_box(self, dialogue_list, index): - """Make the sprite that controls the dialogue""" - image = setup.GFX['dialoguebox'] - rect = image.get_rect() - surface = pg.Surface(rect.size) - surface.set_colorkey(c.BLACK) - surface.blit(image, rect) - dialogue = self.font.render(dialogue_list[index], - True, - c.NEAR_BLACK) - dialogue_rect = dialogue.get_rect(left=50, top=50) - surface.blit(dialogue, dialogue_rect) - sprite = pg.sprite.Sprite() - sprite.image = surface - sprite.rect = rect - self.check_to_draw_arrow(sprite) - - return sprite - - - def make_selection_box(self): - """Make the box for the player to select options""" - image = setup.GFX['shopbox'] - rect = image.get_rect(bottom=608) - - surface = pg.Surface(rect.size) - surface.set_colorkey(c.BLACK) - surface.blit(image, (0, 0)) - - if self.state == 'select': - choices = self.items - elif self.state == 'confirm': - choices = ['Yes', - 'No'] - else: - choices = ['Not', - 'assigned'] - choice1 = self.font.render(choices[0], True, c.NEAR_BLACK) - choice1_rect = choice1.get_rect(x=200, y=25) - choice2 = self.font.render(choices[1], True, c.NEAR_BLACK) - choice2_rect = choice2.get_rect(x=200, y=75) - surface.blit(choice1, choice1_rect) - surface.blit(choice2, choice2_rect) - sprite = pg.sprite.Sprite() - sprite.image = surface - sprite.rect = rect - - return sprite - - - - def check_to_draw_arrow(self, sprite): - """Blink arrow if more text needs to be read""" - if self.index < len(self.dialogue) - 1: - sprite.image.blit(self.arrow.image, self.arrow.rect) - - - def make_gold_box(self): - """Make the box to display total gold""" - image = setup.GFX['goldbox'] - rect = image.get_rect(bottom=608, right=800) - - surface = pg.Surface(rect.size) - surface.set_colorkey(c.BLACK) - surface.blit(image, (0, 0)) - gold = self.level.game_data['player items']['gold'] - text = 'Gold: ' + str(gold) - text_render = self.font.render(text, True, c.NEAR_BLACK) - text_rect = text_render.get_rect(x=80, y=60) - - surface.blit(text_render, text_rect) - - sprite = pg.sprite.Sprite() - sprite.image = surface - sprite.rect = rect - - return sprite - - - - def make_state_dict(self): - """Make the state dictionary for the GUI behavior""" - state_dict = {'dialogue': self.control_dialogue, - 'select': self.make_selection, - 'confirm': self.confirm_selection, - 'reject': self.reject_insufficient_gold, - 'accept': self.accept_purchase} - - return state_dict - - - def control_dialogue(self, keys, current_time): - """Control the dialogue boxes""" - self.dialogue_box = self.make_dialogue_box(self.dialogue, self.index) - - if self.index < (len(self.dialogue) - 1): - if keys[pg.K_SPACE]: - self.index += 1 - - elif self.index == (len(self.dialogue) - 1): - self.state = 'select' - self.timer = current_time - - - def make_selection(self, keys, current_time): - """Control the selection""" - self.dialogue_box = self.make_dialogue_box(self.dialogue, self.index) - self.selection_box = self.make_selection_box() - self.gold_box = self.make_gold_box() - - if keys[pg.K_DOWN]: - self.selection_arrow.rect.topleft = self.arrow_pos2 - elif keys[pg.K_UP]: - self.selection_arrow.rect.topleft = self.arrow_pos1 - elif keys[pg.K_SPACE] and (current_time - self.timer) > 200: - if self.selection_arrow.rect.topleft == self.arrow_pos2: - self.level.done = True - self.level.game_data['last direction'] = 'down' - elif self.selection_arrow.rect.topleft == self.arrow_pos1: - self.state = 'confirm' - self.timer = current_time - - - - def confirm_selection(self, keys, current_time): - """Confirm selection state for GUI""" - dialogue = ['Are you sure?'] - self.selection_box = self.make_selection_box() - self.gold_box = self.make_gold_box() - self.dialogue_box = self.make_dialogue_box(dialogue, 0) - - if keys[pg.K_DOWN]: - self.selection_arrow.rect.topleft = self.arrow_pos2 - elif keys[pg.K_UP]: - self.selection_arrow.rect.topleft = self.arrow_pos1 - elif keys[pg.K_SPACE] and (current_time - self.timer) > 200: - if self.selection_arrow.rect.topleft == self.arrow_pos1: - self.level.game_data['player items']['gold'] -= 30 - if self.level.game_data['player items']['gold'] < 0: - self.level.game_data['player items']['gold'] += 30 - self.state = 'reject' - else: - self.state = 'accept' - else: - self.state = 'select' - self.timer = current_time - self.selection_arrow.rect.topleft = self.arrow_pos1 - - - def reject_insufficient_gold(self, keys, current_time): - """Reject player selection if they do not have enough gold""" - dialogue = ["You don't have enough gold!"] - self.dialogue_box = self.make_dialogue_box(dialogue, 0) - - if keys[pg.K_SPACE] and (current_time - self.timer) > 200: - self.state = 'select' - self.timer = current_time - self.selection_arrow.rect.topleft = self.arrow_pos1 - - - def accept_purchase(self, keys, current_time): - """Accept purchase and confirm with message""" - dialogue = ["Your health has been restored!"] - self.dialogue_box = self.make_dialogue_box(dialogue, 0) - self.gold_box = self.make_gold_box() - - if keys[pg.K_SPACE] and (current_time - self.timer) > 200: - self.state = 'select' - self.timer = current_time - self.selection_arrow.rect.topleft = self.arrow_pos1 - - - def update(self, keys, current_time): - """Updates the shop GUI""" - state_function = self.state_dict[self.state] - state_function(keys, current_time) - - - def draw(self, surface): - """Draw GUI to level surface""" - state_list1 = ['dialogue', 'reject', 'accept'] - state_list2 = ['select', 'confirm'] - - if self.state in state_list1: - surface.blit(self.dialogue_box.image, self.dialogue_box.rect) - surface.blit(self.gold_box.image, self.gold_box.rect) - elif self.state in state_list2: - surface.blit(self.dialogue_box.image, self.dialogue_box.rect) - surface.blit(self.selection_box.image, self.selection_box.rect) - surface.blit(self.selection_arrow.image, self.selection_arrow.rect) - surface.blit(self.gold_box.image, self.gold_box.rect) - - class Shop(tools._State): """Basic shop state""" def __init__(self): super(Shop, self).__init__() - self.map_width = 13 - self.map_height = 10 self.key = None def startup(self, current_time, game_data):

@@ -241,16 +23,23 @@ """Startup state"""

self.game_data = game_data self.current_time = current_time self.state = 'normal' + self.next = c.TOWN self.get_image = tools.get_image self.dialogue = self.make_dialogue() - self.items = self.make_purchasable_items() + self.accept_dialogue = self.make_accept_dialogue() + self.item = self.make_purchasable_items() self.background = self.make_background() - self.gui = Gui(self) + self.gui = shopgui.Gui(self) def make_dialogue(self): """Make the list of dialogue phrases""" raise NotImplementedError + + + def make_accept_dialogue(self): + """Make the dialogue for when the player buys an item""" + return ['Item purchased.'] def make_purchasable_items(self):

@@ -310,14 +99,16 @@ def update(self, surface, keys, current_time):

"""Update level state""" self.gui.update(keys, current_time) self.draw_level(surface) - if self.done: - self.next = c.TOWN def draw_level(self, surface): """Blit graphics to game surface""" surface.blit(self.background.image, self.background.rect) self.gui.draw(surface) + + + + class Inn(Shop):

@@ -329,17 +120,27 @@ self.key = 'innman'

def make_dialogue(self): """Make the list of dialogue phrases""" - dialogue = ["Welcome to the " + self.name + "!", - "Would you like to rent a room to restore your health?"] + return ["Welcome to the " + self.name + "!", + "Would you like to rent a room to restore your health?"] - return dialogue + + def make_accept_dialogue(self): + """Make the dialogue for when the player buys an item""" + return ['Your health has been replenished!'] + def make_purchasable_items(self): """Make list of items to be chosen""" - choices = ['Rent a room. (30 gold)', - 'Leave.'] + dialogue = ['Rent a room. (30 gold)', + 'Leave.'] + + item = {'type': 'room', + 'price': 30, + 'quantity': 0, + 'dialogue': dialogue} + + return item - return choices class WeaponShop(Shop):

@@ -352,17 +153,21 @@

def make_dialogue(self): """Make the list of dialogue phrases""" - dialogue = ["Welcome to the " + self.name + "!", - "Would you like to buy a weapon?"] + return ["Welcome to the " + self.name + "!", + "Would you like to buy a weapon?"] - return dialogue def make_purchasable_items(self): """Make list of items to be chosen""" - choices = ['Long Sword. (100 gold)', - 'Leave.'] + dialogue = ['Long Sword. (100 gold)', + 'Leave.'] - return choices + item = {'type': 'Long Sword', + 'price': 100, + 'quantity': 1, + 'dialogue': dialogue} + + return item class ArmorShop(Shop):

@@ -375,18 +180,21 @@

def make_dialogue(self): """Make the list of dialogue phrases""" - dialogue = ["Welcome to the " + self.name + "!", - "Would you like to buy a piece of armor?"] - - return dialogue + return ["Welcome to the " + self.name + "!", + "Would you like to buy a piece of armor?"] def make_purchasable_items(self): """Make list of items to be chosen""" - choices = ['Chain mail. (30 gold)', - 'Leave.'] + dialogue = ['Chain Mail. (50 gold)', + 'Leave.'] + + item = {'type': 'Chain Mail', + 'price': 50, + 'quantity': 1, + 'dialogue': dialogue} - return choices + return item class MagicShop(Shop):

@@ -399,18 +207,21 @@

def make_dialogue(self): """Make the list of dialogue phrases""" - dialogue = ["Welcome to the " + self.name + "!", - "Would you like to buy a magic spell?"] - - return dialogue + return ["Welcome to the " + self.name + "!", + "Would you like to buy a magic spell?"] def make_purchasable_items(self): """Make list of items to be chosen""" - choices = ['Fire spell. (30 gold)', - 'Leave'] + dialogue = ['Fire Spell. (150 gold)', + 'Leave.'] + + item = {'type': 'Fire Spell', + 'price': 150, + 'quantity': 1, + 'dialogue': dialogue} - return choices + return item class PotionShop(Shop):

@@ -423,15 +234,19 @@

def make_dialogue(self): """Make the list of dialogue phrases""" - dialogue = ["Welcome to the " + self.name + "!", - "Would you like to buy a potion?"] - - return dialogue + return ["Welcome to the " + self.name + "!", + "Would you like to buy a potion?"] def make_purchasable_items(self): """Make list of items to be chosen""" - choices = ['Healing Potion. (30 gold)', - 'Leave'] + dialogue = ['Healing Potion. (15 gold)', + 'Leave.'] - return choices+ item = {'type': 'Healing Potion', + 'price': 15, + 'quantity': 1, + 'dialogue': dialogue} + + return item +
M data/states/town/sprite_start_pos.txtdata/states/town/sprite_start_pos.txt

@@ -25,9 +25,9 @@ 0010001000011000001000100

0011111111111111111111100 0000000000011000000000000 0000000000011000000000000 -00000000001GG100000000000 -0000000001GGGG10000000000 -00000000001GG100000000000 +000000000011110000G000000 +0000000001111110000000000 +0000000000111100000000000 0000000000011000000000000 0000000000011000000000000 0000000000011000000000000

@@ -39,7 +39,7 @@ 0000000000011000000000000

0000000000011000000333000 0003330000011000000333000 0003330000011000000222000 -000222000001100F000222000 +000222000001100E000222000 0002220000011000000010000 0000100000011000000010000 0000111111111111111110000
M data/states/town/town.pydata/states/town/town.py

@@ -35,4 +35,8 @@ elif sprite.location == [10, 7]:

sprite.dialogue = ['Welcome to the castle, citizen.'] elif sprite.location == [13, 7]: sprite.dialogue = ['Move along.'] + elif sprite.location == [18, 27]: + sprite.dialogue = ["Don't be frightened. I'm a friendly Demon.", + "My brothers and sisters, however, are not so nice.", + "Be careful not to run into them."]
M data/tilemap.pydata/tilemap.py

@@ -371,6 +371,12 @@ level_sprites.add(king)

elif letter == 'D': well = person.Well(column*32, row*32) level_sprites.add(well) + elif letter == 'E': + fem_villager = person.FemaleVillager2(column*32, row*32) + level_sprites.add(fem_villager) + elif letter == 'G': + devil_villager = person.Devil(column*32, row*32) + level_sprites.add(devil_villager) tile_map.close()
M data/tools.pydata/tools.py

@@ -161,7 +161,7 @@ 'last direction': 'up',

'town start pos': [12, 49], 'castle start pos': [12, 26], 'king item': {'gold': 500}, - 'player items': player_items + 'player inventory': player_items } return data_dict