all repos — Legends-RPG @ 00a3f968654ae3c3bde4de50fa7c18bbe4190801

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