Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #initial
- wincondition1 = 0
- wincondition2 = 0
- wincondition3 = 0
- weaponXlayer1 = 1
- weaponYlayer1 = 1
- playerhp = 100
- #Internetal
- #If Health is = 2, the game restarts.
- #If Win = 1, the next level is achieved (Left2 +1)
- #If Level2 = 0, the game continues at level 1.
- internal = [ 'Win' , 'Lose' , 'Health' , 'doihaveaweapon' , 'Level2' ]
- internal[0] = 0
- #player
- playerpositionx = 1
- playerpositiony = 1
- #mobs
- headcrabX = 2
- headcrabY = 2
- barnaclex = 2
- barnacley = 3
- staircase1x = 3
- staircase1y = 3
- staircase2x = 3
- staircase2y = 2
- mobs = [ 'Headcrab' , 'Skeleton' , 'd o g' , 'Staircase1X' , 'StairCase1Y']
- #commands
- commands = [ 'moveright' , 'moveleft' , 'moveup' , 'movedown' , 'fight' , 'grab' , ]
- commands[5] = 0
- #floors
- floor2layer1 = [ '1' , '2' , '3' ,]
- floor2layer2 = [ '1' , '2' , '3' ,]
- floor2layer3 = [ '1' , '2' , '3' ,]
- floor3layefr1 = [ '1' , '2' , '3' ,]
- floor3layer2 = [ '1' , '2' , '3' ,]
- floor3layer3 = [ '1' , '2' , '3' ,]
- # intro dialogue
- print("You are trapped in a three story dungeon, and you must get out.")
- print("There is only way out but up, and there are many, many monster lurking. Luckily, there is a crowbar underneath you to protect yourself with. You begin your journey up.")
- print(" ")
- print("Each floor takes foorsteps to move from one side to the next. It is too dark to see anything this far down, so you must guess and move to the position of the stairs.")
- print(" ")
- print("You are at " + str(playerpositionx) + " of three steps right.")
- print("You are at " + str(playerpositiony) + " of three steps up.")
- #level introduction
- print(" ")
- print(" ")
- print(" ")
- print("This is the level.")
- print(" ")
- floor1layer1 = [ '1' , '2' , '3' ,]
- floor1layer2 = [ '1' , '2' , '3' ,]
- floor1layer3 = [ '1' , '2' , '3' ,]
- internal[4] = 0
- print(floor1layer1)
- print(floor1layer2)
- print(floor1layer3)
- print(" ")
- print("Your player is represented by the x on the map.")
- floor1layer3[0] = "x"
- print(" ")
- print(floor1layer1)
- print(floor1layer2)
- print(floor1layer3)
- print(" ")
- #Help
- userround = input("Every round, you will be given an option to interact with the map. Type in the command, 'help' , you will receive a list of commands. " )
- print (" ")
- #Hint #1
- if weaponXlayer1 == playerpositionx and weaponYlayer1 == playerpositiony :
- print("Hey just a hint, there's a weapon right under you. If you like living, you should pick it up.")
- print (" ")
- #Positive Round 1
- while playerpositionx != mobs[3] and playerpositiony != mobs[4] :
- if wincondition1 == 1:
- break
- #moveright false
- if userround == "moveright" and int(playerpositionx) == 3 :
- print("Your player cannot move anymore right, as there x position is: " + str(playerpositionx) + "." )
- print(" ")
- print(floor1layer1)
- print(floor1layer2)
- print(floor1layer3)
- print(" ")
- #moveright
- if userround == "moveright" and 3 > int(playerpositionx) :
- playerpositionx = playerpositionx + 1
- if floor1layer1[0] == "x" :
- floor1layer1[0] = 1
- if floor1layer1[1] == "x" :
- floor1layer1[1] = 2
- if floor1layer1[2] == "x" :
- floor1layer1[2] = 3
- if floor1layer2[0] == "x" :
- floor1layer2[0] = 1
- if floor1layer2[1] == "x" :
- floor1layer2[1] = 2
- if floor1layer2[2] == "x" :
- floor1layer2[2] = 3
- if floor1layer3[0] == "x" :
- floor1layer3[0] = 1
- if floor1layer3[1] == "x" :
- floor1layer3[1] = 2
- if floor1layer3[2] == "x" :
- floor1layer3[2] = 3
- if playerpositionx == 1 and playerpositiony == 1:
- floor1layer3[0] = "x"
- if playerpositionx == 2 and playerpositiony == 1:
- floor1layer3[1] = "x"
- if playerpositionx == 3 and playerpositiony == 1:
- floor1layer3[2] = "x"
- if playerpositionx == 1 and playerpositiony == 2:
- floor1layer2[0] = "x"
- if playerpositionx == 2 and playerpositiony == 2:
- floor1layer2[1] = "x"
- if playerpositionx == 3 and playerpositiony == 2:
- floor1layer2[2] = "x"
- if playerpositionx == 1 and playerpositiony == 3:
- floor1layer1[0] = "x"
- if playerpositionx == 2 and playerpositiony == 3:
- floor1layer1[1] = "x"
- if playerpositionx == 3 and playerpositiony == 3:
- floor1layer1[2] = "x"
- print("Your player has moved one step to the right, making their x position: " + str(playerpositionx) + "." )
- print(" ")
- print(floor1layer1)
- print(floor1layer2)
- print(floor1layer3)
- print(" ")
- #false moveleft
- if userround == "moveleft" and 1 == playerpositionx :
- print("Your player cannot move anymore left, as their x position: " + str(playerpositionx) + ", is equal to 1.")
- print(" ")
- print(floor1layer1)
- print(floor1layer2)
- print(floor1layer3)
- print(" ")
- #moveleft
- if userround == "moveleft" and int(playerpositionx) > 1 :
- playerpositionx = playerpositionx - 1
- if floor1layer1[0] == "x" :
- floor1layer1[0] = 1
- if floor1layer1[1] == "x" :
- floor1layer1[1] = 2
- if floor1layer1[2] == "x" :
- floor1layer1[2] = 3
- if floor1layer2[0] == "x" :
- floor1layer2[0] = 1
- if floor1layer2[1] == "x" :
- floor1layer2[1] = 2
- if floor1layer2[2] == "x" :
- floor1layer2[2] = 3
- if floor1layer3[0] == "x" :
- floor1layer3[0] = 1
- if floor1layer3[1] == "x" :
- floor1layer3[1] = 2
- if floor1layer3[2] == "x" :
- floor1layer3[2] = 3
- if playerpositionx == 1 and playerpositiony == 1:
- floor1layer3[0] = "x"
- if playerpositionx == 2 and playerpositiony == 1:
- floor1layer3[1] = "x"
- if playerpositionx == 3 and playerpositiony == 1:
- floor1layer3[2] = "x"
- if playerpositionx == 1 and playerpositiony == 2:
- floor1layer2[0] = "x"
- if playerpositionx == 2 and playerpositiony == 2:
- floor1layer2[1] = "x"
- if playerpositionx == 3 and playerpositiony == 2:
- floor1layer2[2] = "x"
- if playerpositionx == 1 and playerpositiony == 3:
- floor1layer1[0] = "x"
- if playerpositionx == 2 and playerpositiony == 3:
- floor1layer1[1] = "x"
- if playerpositionx == 3 and playerpositiony == 3:
- floor1layer1[2] = "x"
- print("Your player has moved one step to the left making their x position: " + str(playerpositionx) + "." )
- print(" ")
- print(floor1layer1)
- print(floor1layer2)
- print(floor1layer3)
- print(" ")
- if userround == "moveleft" and int(playerpositionx) == 0 :
- print("Your player cannot move anymore left, as their x position: " + str(playerpositionx) + ", is equal to 0." )
- print(" ")
- print(floor1layer1)
- print(floor1layer2)
- print(floor1layer3)
- print(" ")
- #moveup false
- if userround == "moveup" and int(playerpositiony) == 3 :
- print("Your player cannot move anymore up, as their y position: " + str(playerpositiony) + ", is equal to 3." )
- print(" ")
- print(floor1layer1)
- print(floor1layer2)
- print(floor1layer3)
- print(" ")
- #moveup
- if userround == "moveup" and 3 > int(playerpositiony) :
- playerpositiony = playerpositiony + 1
- print("Your player has moved one step up, making their y position: " + str(playerpositiony) + "." )
- if floor1layer1[0] == "x" :
- floor1layer1[0] = 1
- if floor1layer1[1] == "x" :
- floor1layer1[1] = 2
- if floor1layer1[2] == "x" :
- floor1layer1[2] = 3
- if floor1layer2[0] == "x" :
- floor1layer2[0] = 1
- if floor1layer2[1] == "x" :
- floor1layer2[1] = 2
- if floor1layer2[2] == "x" :
- floor1layer2[2] = 3
- if floor1layer3[0] == "x" :
- floor1layer3[0] = 1
- if floor1layer3[1] == "x" :
- floor1layer3[1] = 2
- if floor1layer3[2] == "x" :
- floor1layer3[2] = 3
- if playerpositionx == 1 and playerpositiony == 1:
- floor1layer3[0] = "x"
- if playerpositionx == 2 and playerpositiony == 1:
- floor1layer3[1] = "x"
- if playerpositionx == 3 and playerpositiony == 1:
- floor1layer3[2] = "x"
- if playerpositionx == 1 and playerpositiony == 2:
- floor1layer2[0] = "x"
- if playerpositionx == 2 and playerpositiony == 2:
- floor1layer2[1] = "x"
- if playerpositionx == 3 and playerpositiony == 2:
- floor1layer2[2] = "x"
- if playerpositionx == 1 and playerpositiony == 3:
- floor1layer1[0] = "x"
- if playerpositionx == 2 and playerpositiony == 3:
- floor1layer1[1] = "x"
- if playerpositionx == 3 and playerpositiony == 3:
- floor1layer1[2] = "x"
- print(" ")
- print(floor1layer1)
- print(floor1layer2)
- print(floor1layer3)
- print(" ")
- #false movedown
- if userround == "movedown" and playerpositiony == 1 :
- print("Your player cannot move anymore down, as their x position: " + str(playerpositiony) + ", is equal to 1.")
- print(" ")
- print(floor1layer1)
- print(floor1layer2)
- print(floor1layer3)
- print(" ")
- #movedown
- if userround == "movedown" and 1 < int(playerpositiony) :
- playerpositiony = playerpositiony - 1
- if floor1layer1[0] == "x" :
- floor1layer1[0] = 1
- if floor1layer1[1] == "x" :
- floor1layer1[1] = 2
- if floor1layer1[2] == "x" :
- floor1layer1[2] = 3
- if floor1layer2[0] == "x" :
- floor1layer2[0] = 1
- if floor1layer2[1] == "x" :
- floor1layer2[1] = 2
- if floor1layer2[2] == "x" :
- floor1layer2[2] = 3
- if floor1layer3[0] == "x" :
- floor1layer3[0] = 1
- if floor1layer3[1] == "x" :
- floor1layer3[1] = 2
- if floor1layer3[2] == "x" :
- floor1layer3[2] = 3
- if playerpositionx == 1 and playerpositiony == 1:
- floor1layer3[0] = "x"
- if playerpositionx == 2 and playerpositiony == 1:
- floor1layer3[1] = "x"
- if playerpositionx == 3 and playerpositiony == 1:
- floor1layer3[2] = "x"
- if playerpositionx == 1 and playerpositiony == 2:
- floor1layer2[0] = "x"
- if playerpositionx == 2 and playerpositiony == 2:
- floor1layer2[1] = "x"
- if playerpositionx == 3 and playerpositiony == 2:
- floor1layer2[2] = "x"
- if playerpositionx == 1 and playerpositiony == 3:
- floor1layer1[0] = "x"
- if playerpositionx == 2 and playerpositiony == 3:
- floor1layer1[1] = "x"
- if playerpositionx == 3 and playerpositiony == 3:
- floor1layer1[2] = "x"
- print("Your player has moved one step up, making their y position: " + str(playerpositiony) + "." )
- print(" ")
- print(floor1layer1)
- print(floor1layer2)
- print(floor1layer3)
- print(" ")
- #grab
- if userround == "grab" and weaponXlayer1 == playerpositionx and weaponYlayer1 == playerpositiony :
- print("You have aquired a crowbar.")
- commands[5] = 1
- print(" ")
- print(floor1layer1)
- print(floor1layer2)
- print(floor1layer3)
- print(" ")
- #grab false
- if userround == "grab" and weaponXlayer1 != playerpositionx and playerpositiony != weaponYlayer1 :
- print("You are not able to grab anything at the coordinates: " + str(playerpositionx) + " x , " + str(playerpositiony) + " y ." )
- print(" ")
- print(floor1layer1)
- print(floor1layer2)
- print(floor1layer3)
- print(" ")
- if userround == "help" :
- print(commands)
- print(" ")
- print(floor1layer1)
- print(floor1layer2)
- print(floor1layer3)
- print(" ")
- #level setter
- if playerpositionx == headcrabX and playerpositiony == headcrabY :
- print("There is an enemy right under you. If you input the 'fight' command, you will be able to live.")
- print(" ")
- print("Your HP is: " + str(playerhp) )
- print("Every time you stumble upon an enemy, you lose 50 hp.")
- playerhp = playerhp - 50
- print("Since you stumbled upon a " + str(mobs[0]) + " , your hp is " + str(playerhp) )
- print(" ")
- print(floor1layer1)
- print(floor1layer2)
- print(floor1layer3)
- #fight
- if playerpositionx == headcrabX and playerpositiony == headcrabY and userround == "fight" and commands[5] == 1 :
- print(" ")
- print("You swing your crowbar.")
- print("The headcrab is dead. What a challenge.")
- playerhp = playerhp + 50
- print("Your hp is " + str(playerhp) )
- print(" ")
- print(floor1layer1)
- print(floor1layer2)
- print(floor1layer3)
- #fight false #1
- if playerpositionx != headcrabX and playerpositiony != headcrabY and userround == "fight" :
- print(" ")
- print("You swing your crowbar.")
- print("There is nothing to be hit.")
- print(floor1layer1)
- print(floor1layer2)
- print(floor1layer3)
- #fight false #1
- if playerpositionx == headcrabX and playerpositiony == headcrabY and userround == "fight" and commands[5] != 0 :
- playerhp = playerhp + 50
- print(" ")
- print("You forgot your crowbar.")
- print("You cannot hit the headcrab.")
- print("Your hp is now" + str(playerhp) )
- print(" ")
- print(floor1layer1)
- print(floor1layer2)
- print(floor1layer3)
- #death
- if playerhp == 0 :
- if floor1layer1[0] == "x" :
- floor1layer1[0] = 1
- if floor1layer1[1] == "x" :
- floor1layer1[1] = 2
- if floor1layer1[2] == "x" :
- floor1layer1[2] = 3
- if floor1layer2[0] == "x" :
- floor1layer2[0] = 1
- if floor1layer2[1] == "x" :
- floor1layer2[1] = 2
- if floor1layer2[2] == "x" :
- floor1layer2[2] = 3
- if floor1layer3[0] == "x" :
- floor1layer3[0] = 1
- if floor1layer3[1] == "x" :
- floor1layer3[1] = 2
- if floor1layer3[2] == "x" :
- floor1layer3[2] = 3
- playerpositionx = 1
- playerpositiony = 1
- floor1layer3[0] = "x"
- print("You are dead. You have respawned at 0,0 .")
- playerhp = 100
- print("Your hp is now" + str(playerhp))
- print(floor1layer1)
- print(floor1layer2)
- print(floor1layer3)
- if playerpositionx == staircase1x and playerpositiony == staircase1y :
- print("You reached the second level!")
- print(" ")
- floor2layer3[0] = "x"
- print(floor2layer1)
- print(floor2layer2)
- print(floor2layer3)
- print(" ")
- print("This is level two.")
- wincondition1 = 1
- userround = input("Input one of the commands here:. ")
- playerpositionx = 0
- playerpositiony = 0
- weaponlayer1x = 0
- weaponlayer1y = 0
- floor2layer3[0] = "x"
- while playerpositionx != mobs[3] and playerpositiony != mobs[4] :
- if wincondition2 == 1:
- break
- #moveright false
- if userround == "moveright" and int(playerpositionx) == 3 :
- print("Your player cannot move anymore right, as there x position is: " + str(playerpositionx) + "." )
- print(" ")
- print(floor2layer1)
- print(floor2layer2)
- print(floor2layer3)
- print(" ")
- #moveright
- if userround == "moveright" :
- playerpositionx = playerpositionx + 1
- if floor2layer3[0] == "x" :
- floor2layer3[0] = 1
- if floor2layer3[1] == "x" :
- floor2layer3[1] = 2
- if floor2layer3[2] == "x" :
- floor2layer3[2] = 3
- if floor2layer2[0] == "x" :
- floor2layer2[0] = 1
- if floor2layer2[1] == "x" :
- floor2layer2[1] = 2
- if floor2layer2[2] == "x" :
- floor2layer2[2] = 3
- if floor2layer1[0] == "x" :
- floor2layer1[0] = 1
- if floor2layer1[1] == "x" :
- floor2layer1[1] = 2
- if floor2layer1[2] == "x" :
- floor2layer1[2] = 3
- if playerpositionx == 1 and playerpositiony == 1:
- floor2layer3[0] = "x"
- if playerpositionx == 2 and playerpositiony == 1:
- floor2layer3[1] = "x"
- if playerpositionx == 3 and playerpositiony == 1:
- floor2layer3[2] = "x"
- if playerpositionx == 1 and playerpositiony == 2:
- floor2layer2[0] = "x"
- if playerpositionx == 2 and playerpositiony == 2:
- floor2layer2[1] = "x"
- if playerpositionx == 3 and playerpositiony == 2:
- floor2layer2[2] = "x"
- if playerpositionx == 1 and playerpositiony == 3:
- floor2layer1[0] = "x"
- if playerpositionx == 2 and playerpositiony == 3:
- floor2layer1[1] = "x"
- if playerpositionx == 3 and playerpositiony == 3:
- floor2layer1[2] = "x"
- print(" ")
- print(floor2layer1)
- print(floor2layer2)
- print(floor2layer3)
- print(" ")
- #moveleft false
- if userround == "moveleft" and int(playerpositionx) == 1 :
- print("Your player cannot move anymore left, as there x position is: " + str(playerpositionx) + "." )
- print(" ")
- print(floor2layer1)
- print(floor2layer2)
- print(floor2layer3)
- print(" ")
- #moveleft
- if userround == "left" and playerpositionx > 1 :
- playerpositionx = playerpositionx - 1
- if floor2layer3[0] == "x" :
- floor2layer3[0] = 1
- if floor2layer3[1] == "x" :
- floor2layer3[1] = 2
- if floor2layer3[2] == "x" :
- floor2layer3[2] = 3
- if floor2layer2[0] == "x" :
- floor2layer2[0] = 1
- if floor2layer2[1] == "x" :
- floor2layer2[1] = 2
- if floor2layer2[2] == "x" :
- floor2layer2[2] = 3
- if floor2layer1[0] == "x" :
- floor2layer1[0] = 1
- if floor2layer1[1] == "x" :
- floor2layer1[1] = 2
- if floor2layer1[2] == "x" :
- floor2layer1[2] = 3
- if playerpositionx == 1 and playerpositiony == 1:
- floor2layer3[0] = "x"
- if playerpositionx == 2 and playerpositiony == 1:
- floor2layer3[1] = "x"
- if playerpositionx == 3 and playerpositiony == 1:
- floor2layer3[2] = "x"
- if playerpositionx == 1 and playerpositiony == 2:
- floor2layer2[0] = "x"
- if playerpositionx == 2 and playerpositiony == 2:
- floor2layer2[1] = "x"
- if playerpositionx == 3 and playerpositiony == 2:
- floor2layer2[2] = "x"
- if playerpositionx == 1 and playerpositiony == 3:
- floor2layer1[0] = "x"
- if playerpositionx == 2 and playerpositiony == 3:
- floor2layer1[1] = "x"
- if playerpositionx == 3 and playerpositiony == 3:
- floor2layer1[2] = "x"
- print(" ")
- print(floor2layer1)
- print(floor2layer2)
- print(floor2layer3)
- print(" ")
- #moveup false
- if userround == "moveup" and int(playerpositiony) == 3 :
- print("Your player cannot move anymore up, as there y position is: " + str(playerpositiony) + "." )
- print(" ")
- print(floor2layer1)
- print(floor2layer2)
- print(floor2layer3)
- print(" ")
- #moveright
- if userround == "moveright" :
- playerpositionx = playerpositionx + 1
- if floor2layer3[0] == "x" :
- floor2layer3[0] = 1
- if floor2layer3[1] == "x" :
- floor2layer3[1] = 2
- if floor2layer3[2] == "x" :
- floor2layer3[2] = 3
- if floor2layer2[0] == "x" :
- floor2layer2[0] = 1
- if floor2layer2[1] == "x" :
- floor2layer2[1] = 2
- if floor2layer2[2] == "x" :
- floor2layer2[2] = 3
- if floor2layer1[0] == "x" :
- floor2layer1[0] = 1
- if floor2layer1[1] == "x" :
- floor2layer1[1] = 2
- if floor2layer1[2] == "x" :
- floor2layer1[2] = 3
- if playerpositionx == 1 and playerpositiony == 1:
- floor2layer3[0] = "x"
- if playerpositionx == 2 and playerpositiony == 1:
- floor2layer3[1] = "x"
- if playerpositionx == 3 and playerpositiony == 1:
- floor2layer3[2] = "x"
- if playerpositionx == 1 and playerpositiony == 2:
- floor2layer2[0] = "x"
- if playerpositionx == 2 and playerpositiony == 2:
- floor2layer2[1] = "x"
- if playerpositionx == 3 and playerpositiony == 2:
- floor2layer2[2] = "x"
- if playerpositionx == 1 and playerpositiony == 3:
- floor2layer1[0] = "x"
- if playerpositionx == 2 and playerpositiony == 3:
- floor2layer1[1] = "x"
- if playerpositionx == 3 and playerpositiony == 3:
- floor2layer1[2] = "x"
- print(" ")
- print(floor2layer1)
- print(floor2layer2)
- print(floor2layer3)
- print(" ")
- #fight
- if playerpositionx == barnaclex and playerpositiony == headcrabY and userround == "fight" and commands[5] == 1 :
- print(" ")
- print("You swing your crowbar.")
- print("The headcrab is dead. What a challenge.")
- playerhp = playerhp + 50
- print("Your hp is " + str(playerhp) )
- print(" ")
- print(floor1layer1)
- print(floor1layer2)
- print(floor1layer3)
- #fight false #1
- if playerpositionx != headcrabX and playerpositiony != headcrabY and userround == "fight" :
- print(" ")
- print("You swing your crowbar.")
- print("There is nothing to be hit.")
- print(floor1layer1)
- print(floor1layer2)
- print(floor1layer3)
- #fight false #1
- if playerpositionx == headcrabX and playerpositiony == headcrabY and userround == "fight" and commands[5] != 0 :
- playerhp = playerhp + 50
- print(" ")
- print("You forgot your crowbar.")
- print("You cannot hit the headcrab.")
- print("Your hp is now" + str(playerhp) )
- print(" ")
- print(floor1layer1)
- print(floor1layer2)
- print(floor1layer3)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement