def gameover(msg):
    #print(msg)
    messegeTurtle = turtle.Turtle()
    messegeTurtle.color("red")
    messegeTurtle.up
    messegeTurtle.write(msg, align="center", font=("Arial", 24, "normal"))
    playsound.play("gameover.wav")
Exemplo n.º 2
0
def progress_with_connection():
    # arr = [
    #     'Cm7', 'Cm7', 'Cm7', 'Cm7', 'Cm7', 'Cm7', 'Cm7', 'Cm7',
    #     'Fm7', 'Fm7', 'Fm7', 'Fm7', 'Fm7', 'Fm7', 'Fm7', 'Fm7',
    #     'Dm7-5', 'Dm7-5', 'Dm7-5', 'Dm7-5', 'G7#5', 'G7#5', 'G7#5', 'G7#5',
    #     'Cm7', 'Cm7', 'Cm7', 'Cm7', 'Cm7', 'Cm7', 'Cm7', 'Cm7',
    #
    #     'Ebm7', 'Ebm7', 'Ebm7', 'Ebm7', 'Ab9', 'Ab9', 'Ab9', 'Ab9',
    #     'DbM7', 'DbM7', 'DbM7', 'DbM7', 'DbM7', 'DbM7', 'DbM7', 'DbM7',
    #     'Dm7-5', 'Dm7-5', 'Dm7-5', 'Dm7-5', 'G7#5', 'G7#5', 'G7#5', 'G7#5',
    #     'Cm7', 'Cm7', 'Cm7', 'Cm7', 'Cm7', 'Cm7', 'G7b9', 'G7b9',
    # ]

    arr = "Bmaj7,D7,Gmaj7,Bb7,Ebmaj7,Ebmaj7,Am7,D7," \
          "Gmaj7,Bb7,Ebmaj7,Gb7,Bmaj7,Bmaj7,Fm7,Bb7," \
          "Ebmaj7,Ebmaj7,Am7,D7," \
          "Gmaj7,Gmaj7,Dbm7,Gb7," \
          "Bmaj7,Bmaj7,Fm7,Bb7," \
          "Ebmaj7,Ebmaj7,D7,D7".split(',')
    arr *= 5
    lastchord = music.Chord('Cmaj7')
    for name in arr:
        c = music.Chord(name)
        c.connect_to(lastchord)
        c.show_info()
        lastchord = c
        ps.play(c, interval=0, duration=0.6)
Exemplo n.º 3
0
Arquivo: mouth.py Projeto: ghards/goku
def fala(fala):
  
  speech = gravar(text = fala, lang = 'pt')
  speech.save(music_file)

  play(music_file)

  system.remove(music_file)
Exemplo n.º 4
0
def touch_mirror(user_name):  #Done
    input(f"Interesting choice {user_name}.")

    print(
        f"""\nAs your fingers touch the ceiling/mirror, it feels like a liquid.
As soon as you do, you feel slingshot into the ceiling/mirror.""")
    play("painting.wav")
    input()
Exemplo n.º 5
0
 def on_point(self, name: str, freq: float):
     "Action to do when encountering a point with given payload"
     if self.options['show_notes']:
         print(self.options['show_notes_template'].format(name, freq))
     time_between_notes = self.options['time_between_notes']
     inthread = time_between_notes != 0
     playsound.play(freq, self.options['duration'], inthread=inthread)
     if time_between_notes is not None and time_between_notes > 0:
         time.sleep(time_between_notes)
Exemplo n.º 6
0
def painting_one(user_name, item_list):  #Done
    """This is the path for painting #1 i.e the AoT painting"""
    print("The monster seems to be eating something human looking.")
    input()
    print("""The hero also looks like they've unresolved childhood trauma.
You look at a particular subject of the painting.
It looks like some beast-looking, titan-sized monster.""")
    input()

    print("""


                  ,   .-'"'=;_  ,
                  |\\.'-~`-.`-`;/|
                  \\.` '.'~-.` './
                  (\\`,__=-'__,'/)
               _.-'-.( d\_/b ).-'-._
             /'.-'   ' .---. '   '-.`\\
           /'  .' (=    (_)    =) '.  `\\
          /'  .',  `-.__.-.__.-'  ,'.  `\\
         (     .'.   V       V  ; '.     )
         (    |::  `-,__.-.__,-'  ::|    )
         |   /|`:.               .:'|\\   |
         |  / | `:.              :' |`\\  |
         | |  (  :.             .:  )  | |
         | |   ( `:.            :' )   | |
         | |    \\ :.           .: /    | |
         | |     \\`:.         .:'/     | |
         ) (      `\\`:.     .:'/'      ) (
         (  `)_     ) `:._.:' (     _(`  )
         \\  ' _)  .'           `.  (_ `  /
          \\  '_) /   .'"```"'.   \\ (_`  /
           `'"`  \  (         )  /  `"'`
       ___        `.`.       .'.'        ___
     .`   ``\"\"\"\'\'\'--`_)     (_'--'\'\'\"\"\"``   `.
    (_(_(___...--'"'`         `'"'--...___)_)_)
    """)

    input()

    boots = "Snow Boots"
    while True:
        if boots not in item_list:
            print("""You also look at the snow boots.
They're very fashionable and seem practical.
You decide to take them.""")
            item_list.append(boots)
            input()

            print("\nYou got Spumoni boots!")
            play("item.wav")

            input(f"\nItems:\n{item_list}")
            input()
            break
        else:
            break
Exemplo n.º 7
0
def sucked_in(user_name):  #Done
    """This is the text for when you touch a painting"""
    input(f"\nGood choice {user_name}.")

    print(
        f"""\nYou defy every sign you've ever seen at a museum and touch the painting.
As soon as you do, you feel slingshot into the painting.""")
    play("painting.wav")
    input()
Exemplo n.º 8
0
def speak(text):
    """
    This function speaks out the text passed
    :param
        text --> str
    :return
        None
    """
    tts = gTTS(text)
    file = './audio/tts.mp3'
    tts.save(file)
    play(file)
Exemplo n.º 9
0
def main():
    lastchord = music.Chord('Cmaj7')
    lastchord.expand()
    while 1:
        try:
            chord = input('> ')
            chord = music.Chord(chord)
            chord.connect_to(lastchord)
            lastchord = chord
            ps.play(chord, interval=0.1, duration=0.2)
        except Exception as e:
            print(e)
Exemplo n.º 10
0
def true_ending(user_name, item_list):  #Done
    """This is the message you get for finding a true ending."""
    input()
    print(
        f"""Congrats on finding one of the true endings in the game {user_name} !
You made the right choices throughout the game and were able to end up here.
Clearly you showed empathy, courage, and altruism in this imaginary game.
Try playing the game again and discovering all 3 true endings!""")
    play("ending.wav")

    input()
    print("Thank you for playing!")
    exit(0)
Exemplo n.º 11
0
def welcome_screen():
    """Welcomes player to game.
Also passes player's name to future functions."""
    input(
        """\n\n\n\n\n\n      __    __   __   __   __   __   __   __    __   __    __   __   __
     _\\/_  _\\/_ _\\/_ _\\/_ _\\/_ _\\/_ _\\/_ _\\/_  _\\/_ _\\/_  _\\/_ _\\/_ _\\/_
     \\/\\/  \\/\\/ \\/\\/ \\/\\/ \\/\\/ \\/\\/ \\/\\/ \\/\\/  \\/\\/ \\/\\/  \\/\\/ \\/\\/ \\/\\/
\t  __    __   __   __   __   __   __   __    __   __    __   __   __
\t _\\/_  _\\/_ _\\/_ _\\/_ _\\/_ _\\/_ _\\/_ _\\/_  _\\/_ _\\/_  _\\/_ _\\/_ _\\/_
\t \\/\\/  \\/\\/ \\/\\/ \\/\\/ \\/\\/ \\/\\/ \\/\\/ \\/\\/  \\/\\/ \\/\\/  \\/\\/ \\/\\/ \\/\\/
      __  __                 _   _             _
     |  \\/  |           /\\  | | | |           | |
     | \\  / |_   _     /  \\ | |_| |_ __ _  ___| | __   ___  _ __
     | |\\/| | | | |   / /\\ \\| __| __/ _` |/ __| |/ /  / _ \\| '_ \\
     | |  | | |_| |  / ____ \\ |_| || (_| | (__|   <  | (_) | | | |
     |_|  |_|\\__, | /_/    \\_\\__|\\__\\__,_|\\___|_|\\_\\  \\___/|_| |_|
       _____  __/ |                  _____      _       _   _
      / ____||___/                  |  __ \\    (_)     | | (_)
     | (___  _   _ _ __   ___ _ __  | |__) |_ _ _ _ __ | |_ _ _ __   __ _ ___
      \\___ \\| | | | '_ \\ / _ \\ '__| |  ___/ _` | | '_ \\| __| | '_ \\ / _` / __|
      ____) | |_| | |_) |  __/ |    | |  | (_| | | | | | |_| | | | | (_| \\__ \\
     |_____/ \\__,_| .__/ \\___|_|    |_|   \\__,_|_|_| |_|\\__|_|_| |_|\\__, |___/
                  | |                                                __/ |
                  |_|                                               |___/
      _    _  _  ____  ____  ___  ____  _____  _  _    ___     ___     _
     / )  ( \\/ )( ___)(  _ \\/ __)(_  _)(  _  )( \\( )  (__ \\   / _ \\   ( \\
    ( (    \\  /  )__)  )   /\\__ \\ _)(_  )(_)(  )  (    / _/  ( (_) )   ) )
     \\_)    \\/  (____)(_)\\_)(___/(____)(_____)(_)\\_)  (____)()\\___/   (_/

     __    __   __   __   __   __   __   __    __   __    __   __   __
    _\\/_  _\\/_ _\\/_ _\\/_ _\\/_ _\\/_ _\\/_ _\\/_  _\\/_ _\\/_  _\\/_ _\\/_ _\\/_
    \\/\\/  \\/\\/ \\/\\/ \\/\\/ \\/\\/ \\/\\/ \\/\\/ \\/\\/  \\/\\/ \\/\\/  \\/\\/ \\/\\/ \\/\\/
\t  __    __   __   __   __   __   __   __    __   __    __   __   __
\t _\\/_  _\\/_ _\\/_ _\\/_ _\\/_ _\\/_ _\\/_ _\\/_  _\\/_ _\\/_  _\\/_ _\\/_ _\\/_
\t \\/\\/  \\/\\/ \\/\\/ \\/\\/ \\/\\/ \\/\\/ \\/\\/ \\/\\/  \\/\\/ \\/\\/  \\/\\/ \\/\\/ \\/\\/"""
    )

    print("\nWelcome to My Attack on Super Paintings! (Python 3 version)")
    play("intro.wav")
    input()
    print(f"Or as the creator of this game calls it, '{sys.argv[0]}' script")
    input()
    player_Name = input("First, what's your name?\n>")
    print(f"""\nNice! Glad to meet you {player_Name}.
Let's get started.""")
    input()
    print("Oh, and make sure you have your volume turned on 🔊")
    input()
    return player_Name
Exemplo n.º 12
0
def get_response(cmd):
    """
    Process the user command and returns response.
    :param
        cmd --> str (command)
    :return:
        response --> str
    """
    global name
    if 'what' in cmd and 'name' in cmd:
        if 'my' in cmd:
            return 'Your name is ' + name
        else:
            return "Hi, I'm Smart Mirror."
    elif 'my name is' in cmd:
        name = cmd.split()[-1]
        return "Okay {}, I'll remember your name.".format(name)
    elif cmd in ['who created you', 'who is your family', 'who is your father', 'who is your mother']:
        return 'Vishwajeet and his team.'
    elif 'how are you' in cmd:
        return "I'm doing well, thank you!"
    elif 'joke' in cmd:
        try:
            res = requests.get('https://icanhazdadjoke.com/', headers={"Accept": "application/json"})
            if res.status_code == requests.codes.ok:
                return str(res.json()['joke'])
            else:
                return 'Oops! I ran out of jokes'
        except requests.RequestException:
            return 'ERROR'
    elif 'send' in cmd:
        contact = get_contact(cmd.split()[-1])
        if contact:
            play('./audio/msg.mp3')
            msg = get_command()
            if msg != 'ERROR':
                if 'email' in cmd:
                    res = send_email(contact['email'], msg)
                    if res:
                        return 'Email sent: '+msg
                elif 'message' in cmd:
                    res = send_message(contact['phone'], msg)
                    if res:
                        return 'Message sent: '+msg
            return 'ERROR'
        return 'Contact not saved!'
    else:
        return get_ans(cmd)
Exemplo n.º 13
0
def randomlyplaywithconnection():
    arr = [
        'Ebmaj7', 'Fm7', 'Fo7', 'G7', 'Abmaj7', 'Ab7', 'Gm', 'Bb7', 'Cm7',
        'Do7', 'Dbmaj7'
    ]
    lastchord = music.Chord('Ebmaj7')
    l = []
    for ch in arr:
        l.append(music.Chord(ch))

    for i in range(200):
        ch = random.choice(l)
        ch.connect_to(lastchord)
        ch.show_info()
        for i in range(1):
            ps.play(ch, interval=0.04, duration=1)
        lastchord = ch
Exemplo n.º 14
0
 def play1(self, pat, width):
     center = width / 2 - 0.5
     if len(pat) == 0:
         play(self.noway_file)
         return
     path = []
     path.append(pat[0] - center)
     for i in range(1, len(pat)):
         path.append(pat[i] - pat[i - 1])
     print(path)
     for step in path:
         if step == 1:
             _thread.start_new_thread(play, (self.turnleft_file, ))
             time.sleep(1)
             print(x)
         if step == 2:
             _thread.start_new_thread(play, (self.hardleft_file, ))
             time.sleep(1)
             print("2")
         if step == -1:
             _thread.start_new_thread(play, (self.turnright_file, ))
             time.sleep(1)
             print("-1")
         if step == -2:
             play(self.hardright_file)
         if step == 0:
             _thread.start_new_thread(play, (self.straight_file, ))
             time.sleep(1)
     play(self.STOP_file)
Exemplo n.º 15
0
def ascii_art_prank():  #Done
    input(
        'Hello, press Enter to start game or CTRL Z at any point to terminate the game.'
    )
    print("""                       __        __   /\\/
                      /==\\      /  \\_/\\/
                    /======\\    \\/\\__ \\__
                  /==/\\  /\\==\\    /\\_|__ \\
               /==/    ||    \\=\\ / / / /_/
             /=/    /\\ || /\\   \\=\\/ /
          /===/   /   \\||/   \\   \\===\\
        /===/   /_________________ \\===\\
     /====/   / |                /  \\====\\
   /====/   /   |  _________    /  \\   \\===\\    THE LEGEND OF
   /==/   /     | /   /  \\ / / /  __________\\_____      ______       ___
  |===| /       |/   /____/ / /   \\   _____ |\\   /      \\   _ \\      \\  \\
   \\==\\             /\\   / / /     | |  /= \\| | |        | | \\ \\     / _ \\
   \\===\\__    \\    /  \\ / / /   /  | | /===/  | |        | |  \\ \\   / / \\ \\
     \\==\\ \\    \\  /____/   /_\\ //  | |_____/| | |        | |   | | / /___\\ \\
     \\===\\ \\   \\\\\\\\\\\\\\/   /////// /|  _____ | | |        | |   | | |  ___  |
       \\==\\/     \\\\\\\\/ / //////   \\| |/==/ \\| | |        | |   | | | /   \\ |
       \\==\\     _ \\/ / /////     _ | |==/     | |        | |  / /  | |   | |
         \\==\\  / \\ / / ///      /|\\| |_____/| | |_____/| | |_/ /   | |   | |
         \\==\\ /   / / /________/ |/_________|/_________|/_____/   /___\\ /___\\
           \\==\\  /               | /==/
           \\=\\  /________________|/=/    OCARINA OF TIME
             \\==\\     _____     /==/
            / \\===\\   \\   /   /===/
           / / /\\===\\  \\_/  /===/
          / / /   \\====\ /====/
         / / /      \\===|===/
         |/_/         \\===/
                        =""")
    play('prank.wav')
    input()
    print("Jk. I'm not that fancy with Python.")
    print("Press 'Enter' again to start the actual game.")
    input()
Exemplo n.º 16
0
def death(item_list, user_name):  #Done
    """This is the message players get upon dying"""
    print("""
                     uuuuuuu
                 uu$$$$$$$$$$$uu
              uu$$$$$$$$$$$$$$$$$uu
             u$$$$$$$$$$$$$$$$$$$$$u
            u$$$$$$$$$$$$$$$$$$$$$$$u
           u$$$$$$$$$$$$$$$$$$$$$$$$$u
           u$$$$$$$$$$$$$$$$$$$$$$$$$u
           u$$$$$$"   "$$$"   "$$$$$$u
           "$$$$"      u$u       $$$$"
            $$$u       u$u       u$$$
            $$$u      u$$$u      u$$$
             "$$$$uu$$$   $$$uu$$$$"
              "$$$$$$$"   "$$$$$$$"
                u$$$$$$$u$$$$$$$u
                 u$"$"$"$"$"$"$u
      uuu        $$u$ $ $ $ $u$$       uuu
     u$$$$        $$$$$u$u$u$$$       u$$$$
      $$$$$uu      "$$$$$$$$$"     uu$$$$$$
    u$$$$$$$$$$$uu    \"\"\"\"\"    uuuu$$$$$$$$$$
    $$$$\"\"\"$$$$$$$$$$uuu   uu$$$$$$$$$\"\"\"$$$\"
     \"\"\"      \"\"$$$$$$$$$$$uu \"\"$\"\"\"
               uuuu \"\"$$$$$$$$$$uuu
      u$$$uuu$$$$$$$$$uu \"\"$$$$$$$$$$$uuu$$$
      $$$$$$$$$$\"\"\"\"           \"\"$$$$$$$$$$$\"
       \"$$$$$\"                      \"\"$$$$\"\"
         $$$"                         $$$$\"
    """)
    play("death.wav")
    input()

    print(f"""Oh no {user_name}!
You died! ⚰
Try playing the game again.
This time, try choosing something different, try choosing more wisely.""")
    exit(0)
Exemplo n.º 17
0
    def play2(self, pat):
        if len(pat) == 0:
            play(self.noway_file)
            self.prev_path = 10
            return
        step = pat[0]

        if step == -1 and (step != self.prev_path or self.count >= 5):
            play(self.turnleft_file)
            self.count = 0
        if step == 1 and (step != self.prev_path or self.count >= 5):
            play(self.turnright_file)
            self.count = 0
        if step == 0 and (step != self.prev_path or self.count >= 5):
            play(self.straight_file)
            self.count = 0
        if step == self.prev_path:
            self.count += 1
        self.prev_path = step
Exemplo n.º 18
0
 def process(*args):
   cmd = In.get()
   cmd1=cmd
   cmd = cmd.split(' ')
   if cmd[0] == 'butterflies':
     play('assets/emacs.wav')
     showinfo("ERROR", "This isn't Emacs...")
   elif cmd[0] == 'play':
     sounds = ['error.wav', 'save.wav', 'emacs.wav']
     if cmd[1] in sounds:
       play('assets/' + cmd[1])
   elif cmd[0] == 'dump':
     uav = ['filename', 'cmd', 'buff']
     if cmd[1] in uav:
       play('assets/dump.wav')
       showinfo("Dump", eval(cmd[1]))
     else:
       error('Not a valid variable')
   else:
     play('assets/error.wav')
     showinfo("ERROR", "Not a valid command")
Exemplo n.º 19
0
def get_command():
    """
    This function listens command and returns text command
    :param
        None
    :return
        None
    """
    r = sr.Recognizer()
    with sr.Microphone() as source:
        r.pause_threshold = 1
        r.adjust_for_ambient_noise(source, duration=1)
        play('./audio/chime.wav')
        audio = r.listen(source)
        play('./audio/chime.wav')
    try:
        command = r.recognize_google(audio).lower()
    except sr.UnknownValueError:
        command = 'ERROR'
        play('./audio/error.mp3')
    return command
Exemplo n.º 20
0
def playNp(audioArr,fs=16000):
    librosa.output.write_wav('/home/london/PycharmProjects/echo/archiv/tempfile.wav',
                             audioArr, fs)

    play('/home/london/PycharmProjects/echo/archiv/tempfile.wav')
Exemplo n.º 21
0
# Escreva um programa que faça o computador
# "pensar" em um número inteiro entre 0 e 5
# e peça para o usuário tentar descobrir
# qual foi o número escolhido pelo computador
# O programa deverá escrever na tela se o usuário
# venceu ou perdeu

from random import randint
from playsound import playsound as play
from time import sleep

num = randint(0, 5)
print('Pensei em um número entre 0 e 5 ')
nu = int(
    input(
        'Tente descobrir em qual número eu pensei!\nDigite um número inteiro: '
    ))
print('PROCESSANDO ...')
sleep(5)
if nu == num:
    print('PARABÉNS! VOCÊ DESCOBRIU!')
    play('./acertou_miseravi.mp3')
    print('VOCÊ: {}'.format(nu))
    print('COMPUTADOR: {}'.format(num))
else:
    print('Sinto muito! Tente outra vez!')
    print('VOCÊ: {}'.format(nu))
    print('COMPUTADOR: {}'.format(num))
    play('./faustao-errou.mp3')
Exemplo n.º 22
0
def my_hero(user_name, item_list):  #Done
    """This is the path for painting #2, i.e. the My Hero Academia painting"""
    Yes = ['Y', 'y', 'Yes', 'yes']
    No = {'N', 'n', 'No', 'no'}

    print("""You land face first.
You stand up and compose yourself.""")

    input()
    print("On the floor, you also notice a bag of money.")

    input()
    print("""──────────────────██████────────────────
─────────────────████████─█─────────────
─────────────██████████████─────────────
─────────────█████████████──────────────
──────────────███████████───────────────
───────────────██████████───────────────
────────────────████████────────────────
────────────────▐██████─────────────────
────────────────▐██████─────────────────
──────────────── ▌─────▌────────────────
────────────────███─█████───────────────
────────────████████████████────────────
──────────████████████████████──────────
────────████████████─────███████────────
──────███████████─────────███████───────
─────████████████───██─███████████──────
────██████████████──────────████████────
───████████████████─────█───█████████───
──█████████████████████─██───█████████──
──█████████████████████──██──██████████─
─███████████████████████─██───██████████
████████████████████████──────██████████
███████████████████──────────███████████
─██████████████████───────██████████████
─███████████████████████──█████████████─
──█████████████████████████████████████─
───██████████████████████████████████───
───────██████████████████████████████───
───────██████████████████████████───────
─────────────███████████████────────────""")

    input()
    print("There's a sign next to it that says 'Free Gift!'")

    money = "100,000 ₩ (KRW)"
    while True:
        print(f"Do you pick it up {user_name}?")
        pick_up_money = input(">")

        if pick_up_money in Yes:
            input(f"\nGood choice {user_name}.")
            item_list.append(money)
            print("\nYou got some money (KRW)!")
            play("item.wav")
            input(f"\nItems:\n{item_list}")
            input()
            break
        elif pick_up_money in No:
            print(
                "\nYou decide to leave it there because you aren't sure if it's a trap."
            )
            input()
            break
        else:
            learn_to_type(user_name, item_list)

    print("""You suddenly hear yelling.
You scan the area and see the person with a disfigured face.
They are being blown away by the punch of a person with a disfigured arm.
You instantly put together that this is All Might defeating All For One.""")
    play("smash.wav")

    input()
    print(
        """As you realize what's happening, you're blown away from the shockwave.
You find your fall broken by some trash bags under a small building.
You decide to let the rest of the chapter from the manga play out.""")

    input()
    print("""You look at the sign of the building that you landed near.
It says "PURIE" and there's a pleasant smell coming from it.
You decide to go in since the fight outside is settled.""")

    input()
    print("""You are greeted by the nicest family of sisters.
You see that they sell jams and perfumes.
It seems business is slow today, probably due to the fight.""")

    input()
    print("They offer to sell you some jam at a discount.")
    input()

    while True:
        if money in item_list:
            jam = input(f"Do you want to buy some {user_name}?\n>")
            if jam in Yes:
                input(f"\nGood choice {user_name}.")
                item_list.pop()

                coco = 'Coconut Jam'
                rose = "Rose Jam"
                wine = "Wine Jam"
                mango = "Mango Jam"

                print(f"""You sample a few different jams, for free!
You buy your favorites and some as a gift for those back home.
It comes out to exactly {money}, nice!""")
                item_list.extend((coco, rose, wine, mango))

                input()
                print("\nYou got some amazing jams!")
                play("item.wav")
                input(f"\nItems:\n{item_list}")

                print("""\nThe Jam Fam thanks you for your patronage.
They give you a gift as 'service'.
Apparently, they've connects in the airline industry."
It's a flight ticket home!""")

                input()
                print(f"Nice!\nYou instantly go home {user_name} ✈ !")
                return true_ending(user_name, item_list)

            elif jam in No:
                print("""\nYou decide to be greedy and hoard your money.
Not only does this have a negative effect on the economy, you also are hungry!
You leave the cozy store in search of food and a way back home.""")

                item_list[:] = []
                input()
                print(
                    "You never find a way back home and eventually starve to death."
                )
                input()
                return death(item_list, user_name)

            else:
                learn_to_type(user_name, item_list)
        elif money not in item_list:
            jam = input(f"Do you want to buy some {user_name}?\n>")
            if jam in Yes:
                print("""
You check your pockets...you don't have any money!
You realized you should've grabbed that free money...
The staff smiles, they are so nice.
They give you a few free samples before you leave.""")

                item_list[:] = []
                input()
                print(
                    "You wander around and never find a way back home and eventually starve to death."
                )
                input()
                return death(item_list, user_name)
            elif jam in No:
                print(
                    """\nYou know you don't have money, so you decline to save face.
Before leaving, the Jam Fam offers you some free samples.
They are so nice!""")

                item_list[:] = []
                input()
                print(
                    "You wander around and never find a way back home and eventually starve to death."
                )
                input()
                return death(item_list, user_name)
            else:
                learn_to_type(user_name, item_list)
        else:
            print("Somehow you broke the game; congrats!")
            death()
Exemplo n.º 23
0
 def play_on_edge(self, direc):
   if direc != self.prev_path:
       play(self.play_dict[direc])
   self.prev_path = direc
Exemplo n.º 24
0
def AOT(user_name, item_list):  #Done
    """This is if the user decides to touch P1; They are now in the AOT world"""
    Yes = ['Y', 'y', 'Yes', 'yes']
    No = ['N', 'n', 'No', 'no']

    print("""You land hard on concrete.
Dazed, you look around as you feel a rhythmic thundering.
The sharp, cold air only adds to your frustration.""")

    input()
    print("""There's snow everywhere.
You decide to put on your new, stylish yet practical snow boots.
They provide a lot more grip than your old shoes.""")

    input()
    print("""You now see the cause of all the thundering.
The Jaw Titan, I mean monster is smashing his way through the city.
It roars, striking terror in your heart.""")

    input()
    print("""        _______________
       /               \\
      /                 \\
    //                   \\/\\
    \\|   XXXX     XXXX   | /
     |   XXXX     XXXX   |/
     |   XXX       XXX   |
     |                   |
     \\__      XXX      __/
       |\     XXX     /|
       | |           | |
       | I I I I I I I |
       |  I I I I I I  |
       \\_             _/
         \\_         _/
           \\_______/""")
    play("roar.wav")

    input()
    print(
        f"""You also see some humans zipping around, using some kind of mechanical device.
There's one next to you, with a sticky note that says 'VME'.""")
    while True:
        grab = input(f"Do you want to grab it {user_name}? \n\n>")

        if grab in Yes:
            VME = 'VME ⚙ '
            item_list.append(VME)
            print("\nYou got the Vertical Maneuvering Equipment (VME)!")
            play("item.wav")

            input()
            print(f"Items:\n{item_list}")

            input()
            print("""You also see a pair of distinctive looking swords.
You think they look cool.
You decide to grab them as well.""")

            input()
            print("You added 'Flesh Pairing Swords' to your items too!")
            play("item.wav")
            swords = 'Flesh Pairing Swords ⚔ '
            item_list.append(swords)

            input()
            print(f"Items:\n{item_list}")

            input()
            print(f"Nice {user_name}!")

            input()
            print(
                """You're feeling prepared to help fight the titan, so you go towards the fight.
As you get there, the hero tells you how to take down a titan.
Given how new you are, you decide you can't fight and will distract the titan."""
            )

            input()
            print("""The titan sees you and starts charging at you.
You use the VME to quickly navigate away, around the corner of some buildings.
The titan is quickly gaining on you and you notice the hero is no longer around.
You start to worry...""")

            input()
            print(
                """You continue turning corners as sharp as possible, trying to shake the titan.
On your last turn, the titan's hand falls upon you.
It barely missed you because you used your swords to parry.
However, the heavy attack has shattered your swords.""")

            input()
            item_list.pop(2)
            print(f"Items:\n{item_list}")

            input()
            print("""You start to panic because now you're defenseless.
But suddenly, you see blood, the titan stops, and then starts to fall.
You see Levi, I mean the hero, standing on the nape of its neck.""")

            input()
            print("""The hero nods in thanks and acknowledgement.
You nod back, thinking that they def should work on their timing.
Your VME is also out of gas, so you decide to discard it.""")

            input()
            item_list.pop(1)
            print(f"Items:\n{item_list}")

            input()
            print("""All of a sudden, you hear a ringing sound.
You wake up...it dawns on you that this was a dream.
You realize you're going to be late for school, so you get out of bed.""")

            input()
            print(
                """But then you notice, you're wearing those dope Spumoni boots.
You take a second to think about what that means....
Your second alarm goes off!
You head out for school, you'll think about all this later.""")

            return true_ending(user_name, item_list)

        elif grab in No:
            print("""
You realize this is outside your capabilities.
You see the titan suddenly swat the hero...it doesn't look good.
The titan then turns to face you; you immediately run away.""")

            input()
            print("""The titan gives chase and you start to panic.
It reaches out with one hand.
You instinctively duck out in a nearby, partially destoryed building.""")

            input()
            print("""Its thundering steps are only getting closer.
Its other hand starts coming for you.
Your mind goes blank, the shadow from its palm closes in on you.""")

            input()
            print("""Just then, you hear an increduibly loud ringing sound.
It's your alarm...
You wake up...you realize it was all a dream.
You also realize you're late!""")

            input()
            item_list[:] = []

            print("You check if you still have the Spumoni boots.")

            input()

            print(f"Items: \n{item_list}")

            input()
            print("""You do not....sadness.
You arrive late to school"
Your homeroom teacher gives you detention.
For life...""")
            input()

            return death(item_list, user_name)

        else:
            learn_to_type(user_name, item_list)
            continue
Exemplo n.º 25
0
from playsound import playsound as play
import datetime
import time

timerhour = int(input("Lütfen Saati Giriniz"))
timerminute = int(input("Lütfen Dakikayı Giriniz"))

while True:

    timenow = datetime.datetime.now()

    hournow = timenow.hour
    minutenow = timenow.minute

    #def bitir(): #Bitirme fonksiyonu (daha çalışmıyor)
    #    g_bitir = input("Bitirmek İçin G ye Basın:")

    #    if  g_bitir == "G":

    #        quit()

    if hournow == timerhour and minutenow == timerminute:
        print("Kalkma Vakti")
        print("Şuanda Saat : ", hournow, ":", minutenow)

        play("your song url")
Exemplo n.º 26
0
    while True:
        status_list = [GPIO.input(25), GPIO.input(24), GPIO.input(23)]
        for i in range(0,3):
            if status_list[i]:
                status_list[i] = "1"
            else:
                status_list[i] = "0"
        # dump current status values in a variable
        current_status = ''.join((status_list[0],status_list[1],status_list[2]))
        # if that variable not same as last time 
        if current_status != previous_status:
            print current_status                # print the results 
            if current_status != "111":
                  if current_status == "110":
			#pressureplate 1
		  	playsound.play("soundeffects/"+random.choice(["CrowCaw.wav","OwlHoot.wav"]))
			system.input = 30
                  elif current_status == "011":
			#doorbell
			system.input = 30
                        thunder.play()
			GPIO.output(4, 1)
                        time.sleep(0.01)
                        GPIO.output(4, 0)
			for flashes in range(5):
			    delay = random.randint(5,30)
			    time.sleep(0.01*delay)
			    GPIO.output(4, 1)
			    time.sleep(0.01)
        		    GPIO.output(4, 0)
                  elif current_status == "101":
Exemplo n.º 27
0
def what_direction(user_name, item_list, smudged_painting):  #Done
    forward = [
        'forward', 'Foward', 'front', 'Front', 'F', 'f', '#1', '1', "pa'lante",
        'adelante', 'pa lante'
    ]
    right = ['right', 'Right', 'r', 'R', '2', '#2', 'derecha']
    left = ['left', 'Left', 'l', 'L', '#3', '3', 'izquierda']
    up = [
        'jump', 'jump up', 'jump off wall', 'jump on wall', 'ceiling', '#4',
        '4', 'j', 'u', 'mirror', 'm'
    ]
    smudged_painting == False

    player_Choice = input(
        f"""So {user_name}, what do you want to do? \nWhat direction do you want to go in?
You can also try to touch the mirror if that's your thing.
>""")

    if player_Choice in forward:  #This allows you to go to painting_1
        walking()
        painting_one(user_name, item_list)
        touch_painting_returned_val = touch_painting(user_name, item_list)

        if touch_painting_returned_val == 'no':
            input()
            what_direction(user_name, item_list, smudged_painting)
        elif touch_painting_returned_val == 'yes':
            sucked_in(user_name)
            AOT(user_name, item_list)
        else:
            print("Somehow you broke the game; congrats!")
            death()

    elif player_Choice in right:  #This allows you to go to painting_2
        walking()
        painting_two(user_name, item_list)
        touch_painting_returned_val = touch_painting(user_name, item_list)

        if touch_painting_returned_val == 'no':
            input()
            what_direction(user_name, item_list, smudged_painting)
        elif touch_painting_returned_val == 'yes':
            sucked_in(user_name)
            my_hero(user_name, item_list)
        else:
            print("Somehow you broke the game; congrats!")
            death()

    elif player_Choice in left:  #This allows you to go to painting_3 and returns smudged_painting as TRUE
        walking()
        painting_three(user_name, item_list)
        touch_painting_returned_val = touch_painting(user_name, item_list)

        while True:
            if touch_painting_returned_val == 'no':
                input()
                what_direction(user_name, item_list, smudged_painting)
                break
            elif touch_painting_returned_val == 'yes' and smudged_painting == False:
                print("""\nYou touching the painting smudged it.
You have ruined the painting.
You are filled with shame ☹ .""")
                play("shame.wav")
                input()

                print(
                    """You quickly look around to see if anyone saw what you did.
No one did because you remembered when the game that said, 'you wake up alone'.
You quickly walk back to the middle of the room after this faux pas.""")
                smudged_painting = True
                input()
                what_direction(user_name, item_list, smudged_painting)
            elif touch_painting_returned_val == 'yes' and smudged_painting == True:
                print(
                    """\nYou reach out to touch the painting, but immediately notice your past mistake.
You are filled with shame again and wonder why you tried this painting again.
You scurry back to the center room, hopefully remembering your choices.""")
                input()
                what_direction(user_name, item_list, smudged_painting)
            else:
                print("Somehow you broke the game; congrats!")
                death()
    elif player_Choice in up:
        print(
            """\nYou get a running start and make towards a blank part of the wall.
As you approach the wall, you push off the ground as hard as you can and jump.
You say \"yahoo!\" for some reason and notice you jump higher than usual.""")
        play("yahoo.wav")
        input()

        print(
            """You hit the mid-point of the wall and you immediately push off it.
You realize you'll have enough force to reach the ceiling/mirror.
You reach out to touch it, your fingers basically scraping it.""")
        input()

        touch_mirror(user_name)

        print(
            """You land, hard back on the carpeted floor in the middle of the first room.
You see your familar surroundings and stand up again, taking in the new info.
You realize the ceiling isn't an exit, so maybe picking a painting is.""")

        input()
        what_direction(user_name, item_list, smudged_painting)
    else:
        learn_to_type(user_name, item_list)
        return what_direction(user_name, item_list, smudged_painting)
Exemplo n.º 28
0
 def play4(self, pat, width):
     center = width / 2 - 0.5
     if len(pat) == 0:
         play(self.noway_file)
         self.prev_path = 10
         return
     path = []
     path.append(pat[0] - center)
     for i in range(1, len(pat)):
         path.append(pat[i] - pat[i - 1])
     print(path)
     if len(path) == 0:
         play(self.noway_file)
         self.prev_path = 10
         return
     step = path[0]
     if step == -1 and (step != self.prev_path or self.count >= 5):
         play(self.turnleft_file)
         self.count = 0
     if step == -2 and (step != self.prev_path or self.count >= 5):
         play(self.hardleft_file)
         self.count = 0
     if step == 1 and (step != self.prev_path or self.count >= 5):
         play(self.turnright_file)
         self.count = 0
     if step == 2 and (step != self.prev_path or self.count >= 5):
         play(self.hardright_file)
         self.count = 0
     if step == 0 and (step != self.prev_path or self.count >= 5):
         play(self.straight_file)
         self.count = 0
     if step == self.prev_path:
         self.count += 1
     self.prev_path = step
Exemplo n.º 29
0
 def play(self, pat, width):
     b = 10
     center = width / 2 - 0.5
     if len(pat) == 0:
         play(self.noway_file)
         return
     path = []
     path.append(pat[0] - center)
     for i in range(1, len(pat)):
         path.append(pat[i] - pat[i - 1])
     print(path)
     for step in path:
         if step == 1 and step != b:
             play(self.turnleft_file)
         if step == 2 and step != b:
             play(self.hardleft_file)
         if step == -1 and step != b:
             play(self.turnright_file)
         if step == -2 and step != b:
             play(self.hardright_file)
         if step == 0 and step != b:
             play(self.straight_file)
         b = step
     play(self.STOP_file)
Exemplo n.º 30
0
def gameover(msg):
    turtle.home()
    turtle.color("red")
    turtle.write(msg,align="center", font=("Arial",20,"bold"))
    playsound.play("gameover.wav")
Exemplo n.º 31
0
from playsound import playsound as play
play_dict = {
    0: 'sounds/guitar.wav',
    1: 'sounds/left.wav',
    -1: 'sounds/right.wav',
    3: 'voice/STOP.mp3',
    2: 'voice/WAIT.mp3',
    4: 'sounds/chair.mp3'
}
while (1):
    a = int(input())
    play(play_dict[a])