def main(): topology = "network.txt" if not os.path.isfile(topology) and os.path.isfile("web/"+topology): topology = "web/"+topology packets(topology=topology, mkDevice=mkDevice, configure=configure, handleEvent=handle)
def main(): levels = ["one.txt", "two.txt", "three.txt", "four.txt", "five.txt"] arenas = ["six.txt", "arena.txt", "giveandtake.txt"] if not os.path.isfile(levels[0]) and os.path.isfile("virus/"+levels[0]): prefix = "virus/" else: prefix = "" pygame.init() #Screen WIDTH, HEIGHT = 480, 320 window = pygame.display.set_mode((WIDTH, HEIGHT)) pygame.display.set_caption('Virus for Android') screen = pygame.display.get_surface() #Music try: pygame.mixer.music.load( "../core/music.wav") pygame.mixer.music.play(-1) winsound = loadSound("winlevel.wav") except Exception: try: pygame.mixer.music.load( "core/music.wav") pygame.mixer.music.play(-1) winsound = loadSound("virus/winlevel.wav") except Exception: winsound = None textScreen(screen, "intro.txt") for level in levels: packets(topology=prefix+level, mkDevice = mkComputer, handleEvent = handle, guard=winningCondition, mkLink = mkLink, screen = screen) if winsound: winsound.play() sleep(.75) for arena in arenas: packets(topology=prefix+arena, mkDevice = mkComputerArena, handleEvent = handle, guard=arenaWin, mkLink = mkLinkArena, screen = screen) if winsound: winsound.play() sleep(.75)
from core.main import packets packets()