コード例 #1
0
def debinarise_all():
    """decompresse les fichiers bex en jex, n'ecrase pas les anciens jex et supprime les bex si jex cree"""
    Inter = Interpreteur()
    for fichier in get_allfiles("../" * bool(__name__ == "__main__") + "map/"):
        path_file = ".".join(fichier.split(".")[:-1])
        if get_ext(fichier) == "bex" and not file_exists(path_file + ".jex"):
            rename(Inter.debinarise(fichier), path_file + ".jex")
            remove(fichier)
コード例 #2
0
ファイル: binarise_all_map.py プロジェクト: weyzohorth/JeX
def debinarise_all():
	"""decompresse les fichiers bex en jex, n'ecrase pas les anciens jex et supprime les bex si jex cree"""
	Inter = Interpreteur()
	for fichier in get_allfiles("../"*bool(__name__ == "__main__")+"map/"):
		path_file = ".".join(fichier.split(".")[:-1])
		if get_ext(fichier) == "bex" and not file_exists(path_file+".jex"):
			rename(Inter.debinarise(fichier), path_file+".jex")
			remove(fichier)
コード例 #3
0
ファイル: binarise_all_map.py プロジェクト: weyzohorth/JeX
def binarise_all():
	"""compresse legerement les fichiers jex en bex, ecrase les anciens bex et supprime les jex source"""
	Inter = Interpreteur()
	for fichier in get_allfiles("../"*bool(__name__ == "__main__")+"map/"):
		path_file = ".".join(fichier.split(".")[:-1])
		if get_ext(fichier) == "jex":
			if file_exists(path_file+".bex") and file_exists(path_file+".jex"): remove(path_file+".bex")
			if not file_exists(path_file+".bex"):
				Inter.binarise(fichier)
				remove(fichier)
コード例 #4
0
class Constantes:
    def __init__(__):
        __.hud = 200
        __.w = __.h = 700
        try:
            data = file("data/data")
            __.vol_musique = int(data.readline()) / 100.
            __.vol_effet = int(data.readline()) / 100.
            __.set_frame_rate(float(data.readline()))
            __.xdec = int(data.readline())
            __.ydec = int(data.readline())
            __.draw_explo = bool(int(data.readline()))
            __.draw_queue = bool(int(data.readline()))
            __.display_online = bool(int(data.readline()))
            data.close()
        except Exception, err:
            print err
            file("data/data",
                 "w").write("100\n100\n24\n0\n0\n1\n1\n640\n640\n1\n")
            __.vol_musique = __.vol_effet = 1.0
            __.set_frame_rate(40)
            __.xdec = __.ydec = 0
            __.draw_explo = __.draw_queue = True
            __.display_online = True
        mixer.music.set_volume(__.vol_musique)

        __.path_img_bloc = "data/images/jeu/blocs/"
        __.path_img_sphere = "data/images/jeu/spheres/"
        __.path_img_menu = "data/images/menu/"
        __.path_musique_jeu = "data/sons/musiques/jeu"
        __.path_musique_menu = "data/sons/musiques/menu"
        __.path_son_effet = "data/sons/effets/"
        __.path_font = "data/fonts/"
        __.path_map = "data/maps/"

        __.musiques_jeu = tuple(get_allfiles(__.path_musique_jeu))
        __.musiques_menu = tuple(get_allfiles(__.path_musique_menu))
        __.len_musiques_jeu = len(__.musiques_jeu)
        __.len_musiques_menu = len(__.musiques_menu)

        __.liste_murs = []
コード例 #5
0
def binarise_all():
    """compresse legerement les fichiers jex en bex, ecrase les anciens bex et supprime les jex source"""
    Inter = Interpreteur()
    for fichier in get_allfiles("../" * bool(__name__ == "__main__") + "map/"):
        path_file = ".".join(fichier.split(".")[:-1])
        if get_ext(fichier) == "jex":
            if file_exists(path_file + ".bex") and file_exists(path_file +
                                                               ".jex"):
                remove(path_file + ".bex")
            if not file_exists(path_file + ".bex"):
                Inter.binarise(fichier)
                remove(fichier)
コード例 #6
0
    def __init__(__, w=960, h=720, fullscreen=0, resolution_screen=()):
        K.n, K.f = 1, 300
        K.Game = __
        pygame.display.init()
        if fullscreen:
            if not resolution_screen:
                Info = pygame.display.Info()
                K.w, K.h = Info.current_w, Info.current_h
            else:
                K.w, K.h = resolution_screen
        else:
            K.w, K.h = w, h
        init(K.w, K.h, K.n, K.f, 150,
             pygame.RESIZABLE | pygame.FULLSCREEN * fullscreen)
        pygame.display.set_caption("jeX", "jeX : go ultra fast")

        K.w2, K.h2 = K.w / 2., K.h / 2.

        glBlendFunc(GL_SRC_ALPHA, GL_ONE)
        __.musiques = list(get_allfiles("data/sounds/music/jeu"))
        __.lim_musiques = len(__.musiques)
        __.boucle()