all repos — Legends-RPG @ 7725c2234297c6e0c00dfdb295d2961f72393d0f

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