0% found this document useful (0 votes)
50 views

Python Game

Uploaded by

eleemather
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
50 views

Python Game

Uploaded by

eleemather
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 3

import time

def finish() :
while True :
if User_Choice == "finish" :
if Trap_numbers >= 50 :
print ("The sun rose. You never thought you would see another day.
However despit all odds, you have survivied. Maybe, just maybe, you will survive.\n
End of Game. You Won")
if Trap_numbers <= 50 :
print ("The zombies approached nearer. You could hear them outside
your base. They edged closer.\n End of Game. You Lost")
Objects =
["Wire","Shovel","Bullet1","Wire_Cutters","Glasses","Camera","Trolley","Axe","Sand_
bags","Bricks","Coin","hose","Batteries","Alcohol","Pain_killers","Canister","Bulle
t2","Loaded_gun","Gun","Sticks","Picture","Trolley_Sand","Trolley_Bricks","Trolley_
Fence","Fence","CAmera_battery","Canister_hose"]
Inventory = [" "]
Interactive_objects =
["Bill","Jeremy","Father_Bernard","Forest","Police_car","Usable_Car","Cash_Register
","Hole_in_Wall","TraoDoor","Lock","Grafitti"]
People = [" "]
Places = ["Crash_site","Shop","Church","Base","Petrol_Station"]
print ("When the undead attacked we weren't ready.","Thinking back, we were never
fully ready for this.","The whole outbreak started over two weeksago and it's been
getting worse ever since.","This time we barely made it. We got away, but Bill got
bitten.","We both knew what that meant....","\nWe decided to stay in this abandoned
building for a while.","We needed to rest and sleep.","A huge horde of the living
dead is coming this way...","\nThey will reach us by sunset.","I have to lock this
place up before that happens and maybe - just maybe- I will live to see another
day.")
User_input = input("Press q to continue: ")
if User_input == "q" :
print("\033c", end="")
User_place = "Base"
print ("You are at the", User_place,", would you like to stay here and look around,
or go somewhere else? \n(Places are in the Places document). If you would like to
finish, type finish. ")
User_Choice = (input()).lower()
finish()
Time_left = 720
metal_fence = "Also outside, there is a metal fence. Part of it has been broken,
but the broken metal is still lying around."
Power_generator_on = " "
bucket_contents = "cement"
Lock_Status = "with a lock on, "
Shovel_status = "with a shovel ontop."
Jeremy_Status = "There is Jeremy at the shop."
camera_status = "In the shop, there is a camera"
zombie_status = "There is also a pit with a zombie inside,"
glasses_Status = " next to the zombie is a set of glasses."
trolley_status = " Outside is a trolley."
Father_Bernard_status = "Inside, there is Father Bernard."
axe_status = "Outside there is an axe."
Sand_bags_status = "There are also some sand bags outside,"
bricks_status = "along with some bricks."
Hose_status = "Hose, "
batteries_status = "Batteries"
alcohol_status = "alcohol"
Shelves_status = " On the shelves there is a" ,Hose_status,batteries_status," and
",alcohol_status,"."
Trap_numbers = 0
def at_base() :
print("\033c", end="")
print ("There is a bin outside the house. There is a small hole in the wall
outside.",metal_fence," Next to the fence there is a power
generator." ,Power_generator_on, "Inside the house, there is a bucket
with" ,bucket_contents, "inside. Futher in side, there is a trap door
",Lock_Status, Shovel_status, "\nIf you would like to interact with something, type
interact. If you would like to leave, type leave: ")
User_Choice = (input()).lower()
def shop() :
print("\033c", end="")
print(Jeremy_Status, "There is also a piece of grafitti on the wall of the
shop. ",camera_status, zombie_status, glasses_Status, trolley_status,"\nIf you
would like to interact with something, type interact. If you would like to leave,
type leave:")
User_Choice = (input()).lower()
def leave() :
print("\033c", end="")
place_choice()
def interact() :
print("\033c", end="")
print("What would you like to interact with? ")
def church() :
print("\033c", end="")
print ("There is a church.",Father_Bernard_status,
axe_status,Sand_bags_status,bricks_status,"\nIf you would like to interact with
something, type interact. If you would like to leave, type leave: ")
User_Choice = (input()).lower()
def petrol_station() :
print("\033c", end="")
print ("There is a cash register.",Shelves_status,".\nIf you would like to
interact with something, type interact. If you would like to leave, type leave: ")
User_Choice = (input ()).lower()
def place_choice() :
if User_Choice == "stay" or "look around" :
at_base()
if User_Choice == "leave" :
leave()

if User_Choice == "interact" :
interact()

if User_Choice == "shop" :
shop()

if User_Choice == "leave" :
leave()

if User_Choice == "interact":
interact()

if User_Choice == "church" :
church()

if User_Choice2 == "leave" :
leave()
if User_Choice == "interact" :
interact()

if User_Choice == "petrol station" :


petrol_station()

if User_Choice2 == "leave" :
leave()

if User_Choice2 == "interact" :
interact()
place_choice()

You might also like