all repos — Legends-RPG @ a55164ece8c0aeea2d6fcc25cf11f80345134f11

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'
24BATTLE = 'battle'
25
26
27def main():
28    """Add states to control here"""
29    run_it = tools.Control(setup.ORIGINAL_CAPTION)
30    state_dict = {TOWN: town.Town(),
31                  MAIN_MENU: main_menu.Menu(),
32                  CASTLE: castle.Castle(),
33                  HOUSE: house.House(),
34                  INN: shop.Inn(),
35                  ARMOR_SHOP: shop.ArmorShop(),
36                  WEAPON_SHOP: shop.WeaponShop(),
37                  MAGIC_SHOP: shop.MagicShop(),
38                  POTION_SHOP: shop.PotionShop(),
39                  OVERWORLD: overworld.Overworld(),
40                  BROTHER_HOUSE: brother_house.House()
41                  }
42
43    run_it.setup_states(state_dict, c.MAIN_MENU)
44    run_it.main()