from play_and_code import *
import random

auswahl = 0
computer_auswahl = 0

phase = 0

tick_speed(2)

def main():
    global auswahl, phase, computer_auswahl

    if phase == 0:

        if is_key_pressed(DOWN):
            auswahl = auswahl + 1

        if is_key_pressed(UP):
            auswahl = auswahl - 1

        if auswahl < 0:
            auswahl = 2
        if auswahl > 2:
            auswahl = 0
        
        print(auswahl)
        schere_color = RED
        stein_color = RED
        papier_color = RED

        if auswahl == 0:
            schere_color = WHITE
        elif auswahl == 1:
            stein_color = WHITE
        elif auswahl == 2:
            papier_color = WHITE
            
        text("Schere 0", schere_color, 200, 200, 35)
        text("Stein 1", stein_color, 200, 300, 35)
        text("Papier 2", papier_color, 200, 400, 35)

        if is_key_pressed(SPACE):
            phase  = 1

    elif phase == 1:
        computer_auswahl = random.randint(0,2)

        #hier anzeigen was pc gewählt hat
        text("wilkommen in phase 1", GREEN, 200, 100, 35)

        #hier anzeigen wer von beiden gewonnen hat

start(main)
