From 36af048fd608839012ae677d8cdc05d9b9ae4241 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 7 Oct 2022 00:55:01 +0100 Subject: [PATCH] created basis of game --- scripts/Text_Game/Text_Game.py | 94 ++++++++++++++++++++++++++++++++++ 1 file changed, 94 insertions(+) create mode 100644 scripts/Text_Game/Text_Game.py diff --git a/scripts/Text_Game/Text_Game.py b/scripts/Text_Game/Text_Game.py new file mode 100644 index 0000000..12bc299 --- /dev/null +++ b/scripts/Text_Game/Text_Game.py @@ -0,0 +1,94 @@ +import random +import time +import sys + +def start(): + print('Hello you r in the future and r fighting a robot') + time.sleep(3) + print('you dont know what to do, thats why im here') + time.sleep(3) + print('I am a Simulated Artificial Machine but u can call me S.A.M.') + smileyface() + +def smileyface(): + time.sleep(0.3) + print('__________________ ') + time.sleep(0.3) + print('| |') + time.sleep(0.3) + print('| @ @ |') + time.sleep(0.3) + print('| ! |') + time.sleep(0.3) + print('| \_______/ |') + time.sleep(0.3) + print('|________________|') + + + +def level1(): + a = '' + while a != 'run away' and a != 'shoot robot in head': + a = input('u can currently do two things which is either run away or shoot robot in head, what do u choose: ') + if a == 'run away': + time.sleep(3) + print('Unfortunately you have now been hunted down by an army of robots and have been executed') + time.sleep(3) + print('too bad') + res = input('Do you wanna restart: ') + if res == 'yes': + start() + level1() + path() + again = choice() + wtf(again) + else: + print('bye') + sys.exit() + elif a == 'shoot robot in head': + time.sleep(3) + print('Congratulations you shot the robot in the head and are not dead!!') + + +def path(): + time.sleep(3) + print('You are running away from the robots but...') + time.sleep(3) + print('there is a dangerous path of an army of robots coming your way') + time.sleep(3) + print('you have got two paths that you can go down') + time.sleep(3) + print('but you have to decide which one is the correct one since one of them is a dead end') + time.sleep(3) + print('choose wisely!!!!!!! ') + print() + +def choice(): + d = '' + while d != '1' and d != '2': + time.sleep(1) + d = input('So which one do you want to go on, path 1 or 2: ') + return d + +def wtf(rightpath): + t = random.randint(1,2) + if rightpath == str(t): + time.sleep(3) + print('good you went down the correct path and cheated death!!') + else: + time.sleep(3) + print('oh no you have been spotted by the robots!!!') + time.sleep(3) + print('and you have been shot multiple time and are now dead.') + + +playAgain = "yes" +while playAgain == "yes" or playAgain == "y": + start() + level1() + path() + again = choice() + wtf(again) + time.sleep(1) + playAgain = input("""Do you want to play again? + Type yes or y to play again and no or n if you want to stop: """) \ No newline at end of file