all repos — Legends-RPG @ c00a96d3b62fa0d580bba601b8f00a621b26947a

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 import shop, levels, battle
 3from . import setup, tools
 4from . import constants as c
 5
 6
 7TOWN = 'town'
 8MAIN_MENU = 'main menu'
 9CASTLE = 'castle'
10HOUSE = 'house'
11INN = 'Inn'
12ARMOR_SHOP = 'armor shop'
13WEAPON_SHOP = 'weapon shop'
14MAGIC_SHOP = 'magic shop'
15POTION_SHOP = 'potion shop'
16PLAYER_MENU = 'player menu'
17OVERWORLD = 'overworld'
18BROTHER_HOUSE = 'brotherhouse'
19BATTLE = 'battle'
20DUNGEON = 'dungeon'
21DUNGEON2 = 'dungeon2'
22DUNGEON3 = 'dungeon3'
23DUNGEON4 = 'dungeon4'
24DUNGEON5 = 'dungeon5'
25
26
27def main():
28    """Add states to control here"""
29    run_it = tools.Control(setup.ORIGINAL_CAPTION)
30    state_dict = {MAIN_MENU: main_menu.Menu(),
31                  TOWN: levels.LevelState(TOWN),
32                  CASTLE: levels.LevelState(CASTLE),
33                  HOUSE: levels.LevelState(HOUSE),
34                  OVERWORLD: levels.LevelState(OVERWORLD, True),
35                  BROTHER_HOUSE: levels.LevelState(BROTHER_HOUSE),
36                  INN: shop.Inn(),
37                  ARMOR_SHOP: shop.ArmorShop(),
38                  WEAPON_SHOP: shop.WeaponShop(),
39                  MAGIC_SHOP: shop.MagicShop(),
40                  POTION_SHOP: shop.PotionShop(),
41                  BATTLE: battle.Battle(),
42                  DUNGEON: levels.LevelState(DUNGEON, True),
43                  DUNGEON2: levels.LevelState(DUNGEON2, True),
44                  DUNGEON3: levels.LevelState(DUNGEON3, True),
45                  DUNGEON4: levels.LevelState(DUNGEON4, True),
46                  DUNGEON5: levels.LevelState(DUNGEON5, True)
47                  }
48
49    run_it.setup_states(state_dict, c.MAIN_MENU)
50    run_it.main()