all repos — Legends-RPG @ a2ffdf647695282f3e789bc49cd116ff8b677ad2

A fantasy mini-RPG built with Python and Pygame.

data/main.py (view raw)

 1from data.states.main_menu import main_menu
 2from data.states.town import town
 3from data.states.castle import castle
 4from data.states import shop
 5from data.states.house import house
 6from . import setup, tools
 7from . import constants as c
 8
 9
10TOWN = 'town'
11MAIN_MENU = 'main menu'
12CASTLE = 'castle'
13HOUSE = 'house'
14INN = 'Inn'
15ARMOR_SHOP = 'armor shop'
16WEAPON_SHOP = 'weapon shop'
17MAGIC_SHOP = 'magic shop'
18POTION_SHOP = 'potion shop'
19
20
21def main():
22    """Add states to control here"""
23    run_it = tools.Control(setup.ORIGINAL_CAPTION)
24    state_dict = {TOWN: town.Town(),
25                  MAIN_MENU: main_menu.Menu(),
26                  CASTLE: castle.Castle(),
27                  HOUSE: house.House(),
28                  INN: shop.Inn(),
29                  ARMOR_SHOP: shop.ArmorShop(),
30                  WEAPON_SHOP: shop.WeaponShop(),
31                  MAGIC_SHOP: shop.MagicShop(),
32                  POTION_SHOP: shop.PotionShop()
33                  }
34
35    run_it.setup_states(state_dict, c.MAIN_MENU)
36    run_it.main()