diff --git a/.idea/workspace.xml b/.idea/workspace.xml index fe225e7..89ec6b6 100644 --- a/.idea/workspace.xml +++ b/.idea/workspace.xml @@ -2,9 +2,8 @@ - - - + + @@ -28,11 +27,9 @@ - - - - - + + + @@ -41,7 +38,7 @@ - + @@ -51,7 +48,7 @@ - + @@ -65,9 +62,9 @@ @@ -75,8 +72,10 @@ - @@ -101,6 +100,8 @@ + + @@ -121,8 +122,6 @@ - - @@ -329,28 +328,28 @@ - + - - - + - - + + + - + + @@ -382,32 +381,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -420,13 +393,59 @@ + + + + + + + + - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/pet_functions.py b/pet_functions.py index aae1089..2211381 100644 --- a/pet_functions.py +++ b/pet_functions.py @@ -15,9 +15,9 @@ from pygame import mixer # variables needed for the guessing game secret = randint(1, 10) -### Functions providing the basic function of the programm +### Functions providing the basic function of the programme ### -# a function which displays the pet's stats in a nice way.' +# a function which displays the pet's stats in a nice way. def pet_stats(): os.system('clear') print(pet_variables.pet_name) @@ -71,14 +71,17 @@ def aging(): print("Congratulation your pet has become an elderly it needs now less food.") print("However it's health is worse and it's grumpier than an adult.") + ### Functions to increase and decrease stats ### def increase_hunger(): pet_variables.pet_hunger = pet_variables.pet_hunger + 1 + def increase_poke_count(): pet_variables.poke_count = pet_variables.poke_count + 1 + def increase_happiness(): if pet_variables.pet_happiness < pet_variables.max_happiness: pet_variables.pet_happiness = pet_variables.pet_happiness + 1 @@ -103,9 +106,11 @@ def decrease_health(): if pet_variables.pet_health > 0: pet_variables.pet_health = pet_variables.pet_health - 1 + def decrease_poke_count(): pet_variables.poke_count = pet_variables.poke_count - 1 + # The function to decrease the stats and make the pet "live" needs to # run in the background. def decrease_stats(): @@ -129,6 +134,7 @@ def stroking(): print("It makes comforting noises and leans against your hand.") time.sleep(1) + # Increases the pets hungriness by +1 unless the hunger is bigger than # the pet's maximum hunger. In this case the pet will vomit and looses hunger # and health. @@ -157,6 +163,7 @@ def playing(): increase_happiness() print("Game over!") + # let's you poke the pet and it will talk # if you poke it more than 3 times it will get angry at you def poking(): @@ -176,6 +183,7 @@ def poking(): mixer.music.play() time.sleep(3) + # A function which let's the pet sleep and regenerates it's stats def sleeping(): os.system('clear')