Learn about me by playing Two Truths and a Lie

stage.set_background("stadium") sprite = codesters.Sprite("cheerleader2",0,-100) sprite.set_say_color("orange") sprite2 = codesters.Sprite("butterfly",-20,150) sprite2.set_size(1) sprite2.set_say_color("orange") score = 0 # Tell the user the topic and how to play. sprite.say("Come learn about me") stage.wait(4) sprite.say("We'll play Two Truths and a Lie") stage.wait(4) sprite.say("You need to pick out the lie each time") stage.wait(4) sprite.say("Choose a, b, or c for each item") stage.wait(2) # first set of truth/lies. sprite.say("I have traveled outside the United States 4 times and visited 7 countries. Which of these is a lie?") stage.wait(4) sprite.say("a) I ate pizza in Italy. \nb) I ate sushi in Japan. \nc) I ate falafel in Israel.") stage.wait(2) choice1 = sprite2.ask("Is a, b or c the lie?") # Check answer if (choice1 == "a"): sprite.say("I'm sorry. I loved pizza in Italy but I didn't try sushi until after I returned from my trip to Japan.") elif (choice1 =="b"): sprite.say("Wow! You're right! Bet I'll stump you on the next one.") score = score + 1 elif (choice1 == "c"): sprite.say("Nope, I had falafel from a street vendor near the Good Fence but I didn't try sushi until after I returned from my trip to Japan.") stage.wait(4) # 2nd set of truth/lies. sprite.say("I started college as a music major and can play quite a few instruments. Which of these isn't true?") stage.wait(4) sprite.say("a) I was 1st chair viola in High School. \nb) I helped teach cello to beginners. \nc) I played guitar in a rock band.") stage.wait(2) choice2 = sprite2.ask("Is a, b or c the lie?") # Check answer if (choice2 == "a"): sprite.say("I'm sorry. I've been playing viola since 3rd grade but I'm classical/folk on guitar not rock.") elif (choice2 == "b"): sprite.say("Nope. I did teach younger players cello but I don't play rock on guitar only classical/folk.") elif (choice2 =="c"): sprite.say("You are correct") score = score + 1 if (score > 1): stage.wait(2) sprite.say("Are you my BFF or did we grow up together? Because you are too good at this.") stage.wait(4) # 3rd set of truth/lies. sprite.say("I'm not much of a cook, but I can bake pretty well. Which of these is a fib?") stage.wait(4) sprite.say("a) I won a Hamantaschen baking contest. \nb) I make a mean cheesecake. \nc) I make cute frosted cakes for birthdays.") stage.wait(2) choice3 = sprite2.ask("Is a, b or c the lie?") # Check answer if (choice3 == "a"): sprite.say("I'm sorry. Idid win the Purim baking contest at my temple but I can't make a cheesecake.") elif (choice3 == "b"): sprite.say("You are correct. Are you clairvoyent?") score = score + 1 elif (choice3 =="c"): sprite.say("I once made my daughter a panda birthday cake - so cute! But I don't make cheesecake.") stage.wait(4) if (score == 3): sprite.say("You're like a human lie detector or something...") elif (score == 2): sprite.say("It's hard to stump you, but I did it once!") else: sprite.say("Well I got you most of the time!") stage.wait(4) sprite.say("Thank you for taking the time to learn a little about me!")
  • Run Code
  • Show Console
  • Codesters How To (opens in a new tab)