Skip to content

Instantly share code, notes, and snippets.

@megamaz
Last active April 21, 2019 00:20
Show Gist options
  • Save megamaz/41cfb50c3779f32018119f9e9ff540c1 to your computer and use it in GitHub Desktop.
Save megamaz/41cfb50c3779f32018119f9e9ff540c1 to your computer and use it in GitHub Desktop.
The way
import random
import time
import sys
best = open("shot.txt", "a+")
sleeptime = float(input("Enter how much time in between dialogues: "))
time_lived = 0
ammo = 6
print("\n" * 100)
def Print(script):
print("/ " + ((len(script) + 1) * "~") + " \ ")
print(" " + "[" + script + "]")
print("\ " + ((len(script) + 1) * "~") + " /")
time.sleep(sleeptime)
print("\n" * 100)
Print("You are lost in the dark")
Print("All you know is that you've got a weapon")
Print("...")
Print("Monsters are on the way")
while True:
monster = random.randint(1, 2)
find_ammo = random.randint(-3, 3)
if monster == 1:
Print("a monster is in front of you.")
if ammo <= 0:
Print("You are out of ammo.")
Print("GAME OVER")
break
elif ammo > 0:
Print("You shoot him.")
ammo -= 1
Print("You now have " + str(ammo) + " ammo")
elif monster == 2:
Print("You walk forward.")
if find_ammo <= 0:
continue
elif find_ammo > 0:
Print("You found " + str(find_ammo) + " ammo!")
ammo += find_ammo
if ammo > 6:
ammo = 6
Print("You are now full on ammo")
elif ammo < 6:
Print("You now have " + str(ammo) + " ammo")
elif ammo == 6:
Print("You are now full on ammo")
time_lived += 1
Print("It has been " + str(time_lived) + " minutes.")
Print("you lived " + str(time_lived) + " minutes.")
for i in range(1):
best.write("NEW-" + str(time_lived) + " minutes \r\n")
best.close()
Print("It has been added to your records.")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment