示例#1
0
        noun = " ".join(words[1:])
        return verb, noun

    def exits(new_room, current_room):
        """Checks to see the available exits of a room are. These exits are retrieved from the XML game map under
        the tag 'Exit'"""
        exitList = []
        for eachExit in room_dict[current_room].Exit:
            exitCoord = literal_eval(eachExit.value)
            exitList.append(exitCoord)
        if new_room in exitList:
            return new_room
        else:
            print 'You can\'t go that way.'
            time.sleep(1)
        return current_room

    os.system('mode con: cols=110 lines=90')
    homeScreen()

logger = logging.out_file_instance('Logs\\Zombie Raid')
if __name__ == '__main__':
    try:
        main()
    except SystemExit:
        pass
    except:
        exception_string = traceback.format_exc()
        logger.write_line([exception_string])
        print exception_string
示例#2
0
import the_map
import sys
import os
import random
import time
from Q2API.util import logging
import traceback
from ast import literal_eval
from operator import itemgetter
import pygame, pygame.mixer

logger = logging.out_file_instance("Secret_of_Texts")
rooms_by_name = dict()
boss_count = 0
player_inventory =[]
player = None
game_map = None
sword_count = 1
mana_sword = 1
wallet = 0
score = 0
party = []
hero_in_party = False
princess_in_party = False
sprite_in_party = False

def main():
    global game_map
    global player_inventory
    global wallet
示例#3
0
import os
from Q2API.util import logging
import traceback
from game import Game
from time import sleep
from Imports import ascii_art
from colorconsole import terminal
import pygame.mixer

logger = logging.out_file_instance("Logs/game_log")
screen = terminal.get_terminal()


def main():
    os.system('cls')
    screen.set_title("ELEVEN")
    pygame.mixer.init()
    sound = pygame.mixer.Sound("Sounds/Lava_Dome_8bit.wav")
    sound.set_volume(.10)
    sound.play(loops=100)
    #pygame.mixer.fadeout(100000)
    if os.listdir("Saved_Files"):
        file_name = prompt_save()
        game = Game(file_name, sound)
    else:
        game = Game("Q2API_XML/creepy.xml", sound)

    screen.clear()
    # Slow text via sleep for intro
    #for line in game.intro.split("        "):
    #     sys.stdout.write(line),