Example #1
0
        'small_grey': bmpfont.BmpFont("Small_Grey"),
        'small_green': bmpfont.BmpFont("Small_Green"),
        'small_red': bmpfont.BmpFont("Small_Red"),
        'small_white': bmpfont.BmpFont("Small_White"),
        'chapter_white': bmpfont.BmpFont("Chapter_White"),
        'chapter_green': bmpfont.BmpFont("Chapter_Green"),
        'stat_white': bmpfont.BmpFont("Stat_White")}

MAINFONT = "Sprites/Fonts/KhmerUI.ttf"
BASICFONT = pygame.font.Font(MAINFONT, 10)
BIGFONT = pygame.font.Font(MAINFONT, 12)

DISPLAYSURF = pygame.display.set_mode((WINWIDTH*OPTIONS['screen_scale'], WINHEIGHT*OPTIONS['screen_scale']))

IMAGESDICT, UNITDICT, ICONDICT, ITEMDICT = getImages()
SOUNDDICT, MUSICDICT = getSounds()

# Helper global object for passive sprite animations
class generic3Counter(object):
    def __init__(self, first_time = 500, second_time = 50, third_time = None):
        self.count = 0
        self.lastUpdate = pygame.time.get_ticks()
        self.lastcount = 1
        self.first_time = first_time
        self.second_time = second_time
        self.third_time = self.first_time if third_time is None else third_time
        
    def update(self):
        current_time = pygame.time.get_ticks()
        if self.count == 1 and current_time - self.lastUpdate > self.second_time:
            self.increment()
Example #2
0
# Icon
small_icon = Engine.image_load(Engine.engine_constants['home'] +
                               'Sprites/General/main_icon.png')
# Engine.set_colorkey(small_icon, (0, 0, 0), False)
Engine.set_icon(small_icon)

FPSCLOCK = Engine.clock()
DISPLAYSURF = Engine.build_display((WINWIDTH * cf.OPTIONS['Screen Size'],
                                    WINHEIGHT * cf.OPTIONS['Screen Size']))
Engine.set_caption(''.join([cf.CONSTANTS['title'], " - ", version]))
print('Version: v%s' % version)

IMAGESDICT, UNITDICT, ICONDICT, ITEMDICT, ANIMDICT = imagesDict.getImages(
    Engine.engine_constants['home'])
SOUNDDICT, MUSICDICT = imagesDict.getSounds(Engine.engine_constants['home'])

# DATA
try:
    import xml.etree.cElementTree as ET
except ImportError:
    import xml.etree.ElementTree as ET
# Outside data
# === CREATE ITEM DICTIONARY =================================================
loc = Engine.engine_constants['home']


def create_item_dict():
    item_dict = {}
    # For each lore
    for idx, entry in enumerate(