all repos — Legends-RPG @ 7728ded4533e4190e419a6c010b6e07c67e1d583

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'
24
25
26def main():
27    """Add states to control here"""
28    run_it = tools.Control(setup.ORIGINAL_CAPTION)
29    state_dict = {MAIN_MENU: main_menu.Menu(),
30                  TOWN: levels.LevelState(TOWN),
31                  CASTLE: levels.LevelState(CASTLE),
32                  HOUSE: levels.LevelState(HOUSE),
33                  OVERWORLD: levels.LevelState(OVERWORLD, True),
34                  BROTHER_HOUSE: levels.LevelState(BROTHER_HOUSE),
35                  INN: shop.Inn(),
36                  ARMOR_SHOP: shop.ArmorShop(),
37                  WEAPON_SHOP: shop.WeaponShop(),
38                  MAGIC_SHOP: shop.MagicShop(),
39                  POTION_SHOP: shop.PotionShop(),
40                  BATTLE: battle.Battle(),
41                  DUNGEON: levels.LevelState(DUNGEON, True),
42                  DUNGEON2: levels.LevelState(DUNGEON2, True),
43                  DUNGEON3: levels.LevelState(DUNGEON3, True),
44                  DUNGEON4: levels.LevelState(DUNGEON4, True)
45                  }
46
47    run_it.setup_states(state_dict, c.MAIN_MENU)
48    run_it.main()