コード例 #1
0
def doImport():
    try:
        success = False

        if IMPORT_RESET:
            profile = os.path.join(ROOT, 'Super Favourites')
            try:    sfile.rmtree(profile)
            except: pass

        if REMOTE:
            success = _doImportFromRemote()
        else:
            filename = getFile(GETTEXT(30134), 'zip')

            if not filename:
                return False

            success = _doImportFromLocal(filename)

        if success:
            utils.DialogOK(GETTEXT(30133))
            if CHANGELOG:
                utils.showText(TITLE, CHANGELOG, True)               
            return True
    except:
        pass

    utils.DialogOK(GETTEXT(30137))
    return False
コード例 #2
0
ファイル: scenes.py プロジェクト: cty012/flappy-bird
def fail(screen, scoreboard):
    # draw
    text = 'You Have Failed With a Score of {}'.format(scoreboard.score)
    utils.showText(screen, text, p.title_pos, p.font, 50, (255, 0, 0))
    text = 'press "SPACE" to play again'
    utils.showText(screen, text, p.subtitle_pos, p.font, 30, (0, 0, 0))
    pygame.display.update()

    return 'failed'
コード例 #3
0
ファイル: scenes.py プロジェクト: cty012/flappy-bird
def start(screen, clock, bird):
    # draw
    screen.fill(p.background)
    bird.show(screen)
    text = 'Flappy Circular Bird Floating in Vacuum'
    utils.showText(screen, text, p.title_pos, p.font, 50, (0, 0, 0))
    text = 'press "SPACE" to play'
    utils.showText(screen, text, p.subtitle_pos, p.font, 30, (0, 0, 0))
    pygame.display.update()

    # detect operation
    events = pygame.event.get()
    for e in events:
        if e.type == pygame.QUIT:
            return 'quit'
        elif e.type == pygame.KEYDOWN and e.key == pygame.K_SPACE:
            return 'game'

    # wait
    clock.tick_busy_loop(80)
    return 'start'
コード例 #4
0
def doImport():
    try:
        success = False

        if REMOTE:
            success = _doImportFromRemote()
        else:
            filename = getFile(GETTEXT(30134), 'zip')

            if not filename:
                return False

            success = _doImportFromLocal(filename)

        if success:
            utils.DialogOK(GETTEXT(30133))
            if CHANGELOG:
                utils.showText(TITLE, CHANGELOG, True)
            return True
    except:
        pass

    utils.DialogOK(GETTEXT(30137))
    return False
コード例 #5
0
ファイル: importer.py プロジェクト: NEOhidra/spoyser-repo
def doImport():
    try:
        success = False

        if REMOTE:
            success = _doImportFromRemote()
        else:
            filename = getFile(GETTEXT(30134), 'zip')

            if not filename:
                return False

            success = _doImportFromLocal(filename)

        if success:
            utils.DialogOK(GETTEXT(30133))
            if CHANGELOG:
                utils.showText(TITLE, CHANGELOG, True)               
            return True
    except:
        pass

    utils.DialogOK(GETTEXT(30137))
    return False