コード例 #1
0
def run_optimized():
    if __debug__:
        # start subprocess
        subp_args = [str(sys.executable), "-O", str(__file__)]
        for arg in sys.argv[1:]:
            subp_args.append(arg)
        #subprocess.Popen(subp_args)
        subprocess.call(subp_args)
    else:
        # running optimized
        # import the game
        from gamelib import main
        main.main()
コード例 #2
0
def run_debug():
    # running in debug mode
    if u"-profile" in sys.argv:
        import cProfile
        import tempfile
        import os

        profile_data_fname = "t.profile"  # tempfile.mktemp("prf")
        try:
            cProfile.run("main.main()", profile_data_fname)
        finally:
            pass
    else:
        main.main()
コード例 #3
0
#! /usr/bin/env python
from gamelib import main

main.main()
コード例 #4
0
#Importando as bibliotecas
import pygame, os, sys
from pygame.locals import *
from gamelib import main
#Chamando a class main no arquivo main.py
main.main()
#O main é responsavel por definir o tamanho do display, iniciar as funções da pygame e chamar a class menu()
コード例 #5
0
ファイル: run_game.py プロジェクト: pdevine/suburbia
#! /usr/bin/env python

from gamelib import main
import sys

sound = True
fps = False

if '--nosound' in sys.argv:
    sound = False

if '--fps' in sys.argv:
    fps = True

main.main(sound, fps)

コード例 #6
0
ファイル: run_game.py プロジェクト: avuserow/yoyobrawlah
sound = True


def usage(argv):
    print "Usage: %s [OPTIONS]" % argv[0]
    print
    print "Option           Description"
    print "--nosound        Turn off in game music"
    print "--vsync          Turn on monitor verticle sync"
    print


try:
    opts, args = getopt.getopt(sys.argv[1:], "", ["vsync", "nosound"])
except getopt.GetoptError, err:
    print "unrecognized command"
    usage(sys.argv)
    sys.exit(1)

for opt, arg in opts:

    if opt == "--vsync":
        print "vsync on"
        vsync = True
    elif opt == "--nosound":
        print "sound off"
        sound = False


main.main(vsync, sound)
コード例 #7
0
ファイル: run_game.py プロジェクト: toli/yoyobrawlah
vsync = False
sound = True

def usage(argv):
    print "Usage: %s [OPTIONS]" % argv[0]
    print
    print "Option           Description"
    print "--nosound        Turn off in game music"
    print "--vsync          Turn on monitor verticle sync"
    print

try:
    opts, args = getopt.getopt(sys.argv[1:], '', ['vsync', 'nosound'])
except getopt.GetoptError, err:
    print "unrecognized command"
    usage(sys.argv)
    sys.exit(1)

for opt, arg in opts:

    if opt == '--vsync':
        print "vsync on"
        vsync = True
    elif opt == '--nosound':
        print "sound off"
        sound = False
        

main.main(vsync, sound)