Exemple #1
0
def lang_button_image():
    return files.resource_path(
        '', 'images\\' + lang() + '_' + switch_language(False) + '.png')
Exemple #2
0
def sound_button_image():
    return files.resource_path('', 'images\\' + toggle_sound(False) + '.png')
Exemple #3
0
import sys
import webbrowser

import tkinter as tk

import i18n
import sound_win as sound
import files

foxPng = files.resource_path('', r'images\fox.png')
github_button_png = files.resource_path('', 'images\github.png')


def combine_funcs(*funcs):
    def combined_func(*args, **kwargs):
        for f in funcs:
            f(*args, **kwargs)

    return combined_func


def callback_GitHub(event):
    webbrowser.open_new(r"https://github.com/andb0t/Fuxenpruefung")


def callback_AGV(event):
    webbrowser.open_new(r"http://agv-muenchen.de/")


def center_window(root, xdist=0, ydist=0):
    # get screen width and height
Exemple #4
0
MAX_BEER = 11
BEER_RESPAWN_CHANCE = 0.7

START_SPEED = 1 / 50
MAX_SPEED = 4 / 50
N_SPEED_STEPS = 10

START_ROTATION_SPEED = 0.05
MAX_ROTATION_SPEED = 0.10
N_ROTATION_SPEED_STEPS = 10

START_TUMBLE_ANGLE = 5
MAX_TUMBLE_ANGLE = 45
N_TUMBLE_STEPS = 10

majorImgPath = files.resource_path('', r'images\major.png')
foxImgPath = files.resource_path('', r'images\fox.ico')
beerImgPath = files.resource_path('', r'images\beer.png')
starImgPath = files.resource_path('', r'images\star.png')
bucketImgPath = files.resource_path('', r'images\bucket.png')
floorImgPath = files.resource_path('', r'images\floor.jpg')


def get_angle(x0, y0, x1, y1):
    mag0 = math.sqrt(x0**2 + y0**2)
    mag1 = math.sqrt(x1**2 + y1**2)
    if not mag0 or not mag1:
        return 0
    dot = x0 * x1 + y0 * y1
    det = x0 * y1 - x1 * y0
    angle = math.degrees(math.atan2(det, dot))
Exemple #5
0
def change_catagories(category, categoryUpdate):
    for key in categoryUpdate.keys():
        try:
            idx = list(map(lambda a: a[2], category)).index(key)
        except ValueError:
            continue
        category[idx][0] = categoryUpdate[key]
    return category


sound.start_sound()
taskVar = 0
zipPasswd = ''
questionFile = ''
categoryUpdate = {}
foxIco = files.resource_path('', r'images\fox.ico')


while True:

    lang_button_png = i18n.lang_button_image()
    sound_buttong_png = sound.sound_button_image()

    categories = [
                  [16, i18n.longNames[i18n.lang()][0], i18n.shortNames[i18n.lang()][0]],
                  [6, i18n.longNames[i18n.lang()][1], i18n.shortNames[i18n.lang()][1]],
                  [4, i18n.longNames[i18n.lang()][2], i18n.shortNames[i18n.lang()][2]],
                  [1000, i18n.longNames[i18n.lang()][3], i18n.shortNames[i18n.lang()][3]],
                  [5, i18n.longNames[i18n.lang()][4], i18n.shortNames[i18n.lang()][4]],
                  [0, i18n.longNames[i18n.lang()][5], i18n.shortNames[i18n.lang()][5]],
                 ]
Exemple #6
0
def start_sound():
    global SOUND_IS_ON
    songWav = files.resource_path('', r'sounds\Ehr_unser_Zier.wav')
    winsound.PlaySound(songWav, winsound.SND_FILENAME | winsound.SND_ASYNC)
    SOUND_IS_ON = True