Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ### Create a puzzle game based off Doodle God ###
- strMyElements = ""
- tierOne = ["Fire","Water","Air","Earth"] # Tier One is the first lot of elements #
- recipes = {"FireEarth":"Lava","FireWater":"Steam","WaterAir":"Clouds","LavaWater":"Stone",
- "WaterEarth":"Sand","FireSand":"Glass","CloudsAir":"Wind","WindSand":"Desert",
- "FireAir":"Energy","WaterFire":"Alcohol","AlcoholEnergy":"Life","EarthLife":"Seeds",
- "SeedsEarth":"Sapling","SaplingTime":"Tree","SaplingEarth":"Grass","GrassStone":"Time"}
- myElements = tierOne # myElements is the elements that the player has discovered #
- noElements = 0
- def combine():
- global myElements
- global strMyElements
- global recipes
- global noElements
- correct = 0
- correct2 = 0
- ### This is the achievement area ###
- if noElements == 10:
- input("\n...")
- input("\nYou have discovered 10 Elements!")
- input('''"God does not play dice with the universe...
- Unless he can program in python, then all he has to do is import random!"
- - Albert Einstein (revised)\n''')
- if noElements == 20:
- input("\n...")
- input("\nYou have discovered 20 Elements!")
- input('''"Because tonight! Tonight is gonna be:
- Legend... Wait for it... Dary!!!"
- - Barney Stinsen (I think...)\n''')
- if noElements == 30:
- input("\n...")
- input("\nYou have discovered 30 Elements!")
- input('''"Have you tried turning it off and on again?"
- - Roy Trenneman (IT Crowd)\n''')
- ### This code is for showing the player what elements they have discovered ###
- print("You have discovered " + str(noElements) + " elements!")
- print("\nThe elements that you have discovered are:\n" + str(myElements))
- ### Ask the player to try combining elements ###
- combo1 = input("\nSelect the first element from the list to combine >> ")
- for i in myElements:
- scanElement = str(i)
- if combo1.lower() == scanElement.lower(): # If you have the element you want to combine #
- correct = 1
- break
- if correct == 0: # If you don't #
- input("You need to have discovered the element to use it!")
- combine()
- ### Repeat for combo2 ###
- combo2 = input("Select the second element from the list to combine >> ")
- for i in myElements:
- scanElement = str(i)
- if combo2.lower() == scanElement.lower():
- correct2 = 1
- break
- if correct2 == 0:
- input("You need to have discovered the element to use it!")
- combine()
- for i in recipes:
- if combo1.lower() + combo2.lower() == i.lower(): # Check if it's a recipe
- input("You made " + recipes[i] + "!")
- newElement = str(recipes[i])
- if newElement not in myElements:
- noElements = noElements + 1
- myElements.append(newElement) # Add the newly discovered element to myElements #
- elif combo2.lower() + combo1.lower() == i.lower():
- input("You made " + recipes[i] + "!")
- newElement = str(recipes[i])
- if newElement not in myElements:
- noElements = noElements + 1
- myElements.append(newElement)
- combine()
- combine()
- ### NOTES:
- ###
- ### - This code uses a single function. I didn't use it like a function
- ### and I know that this can cause problems but... Who cares? (Probably me in a week)
- ### - When the game prints the Elements that you have discovered, it prints the entire
- ### array. This doesn't look as nice as printing each Element independantly but I got
- ### lazy...
- ### - The code should probably tell you that your reaction did nothing. But, once again,
- ### I'm lazy
- ### - The code has been written in such a way that you can add as many new Elements and
- ### combinations later if you think the game is too easy to complete
- ### - I have set up an in-game achievement system. It tells you that you've reached a
- ### certain milestone and gives you a quote when you do
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement