doing some cleanup

This commit is contained in:
Andreas Zweili 2015-07-12 23:10:17 +02:00
parent a3bc091008
commit e3fe4e7da3
2 changed files with 80 additions and 53 deletions

View File

@ -2,9 +2,8 @@
<project version="4">
<component name="ChangeListManager">
<list default="true" id="4b67389a-e8cb-4c8f-9941-148698aed835" name="Default" comment="">
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/README.md" afterPath="$PROJECT_DIR$/README.md" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/pet_variables.py" afterPath="$PROJECT_DIR$/pet_variables.py" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/tamagotchi.py" afterPath="$PROJECT_DIR$/tamagotchi.py" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/pet_functions.py" afterPath="$PROJECT_DIR$/pet_functions.py" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/.idea/workspace.xml" afterPath="$PROJECT_DIR$/.idea/workspace.xml" />
</list>
<ignored path="tamagotchi.iws" />
<ignored path=".idea/workspace.xml" />
@ -28,11 +27,9 @@
<file leaf-file-name="pet_functions.py" pinned="false" current-in-tab="true">
<entry file="file://$PROJECT_DIR$/pet_functions.py">
<provider selected="true" editor-type-id="text-editor">
<state vertical-scroll-proportion="0.0">
<caret line="0" column="0" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" />
<folding>
<element signature="e#0#20#0" expanded="true" />
</folding>
<state vertical-scroll-proportion="-2.690205">
<caret line="20" column="0" selection-start-line="20" selection-start-column="0" selection-end-line="20" selection-end-column="0" />
<folding />
</state>
</provider>
</entry>
@ -41,7 +38,7 @@
<entry file="file://$PROJECT_DIR$/pet_variables.py">
<provider selected="true" editor-type-id="text-editor">
<state vertical-scroll-proportion="0.0">
<caret line="0" column="7" selection-start-line="0" selection-start-column="7" selection-end-line="0" selection-end-column="7" />
<caret line="3" column="4" selection-start-line="3" selection-start-column="4" selection-end-line="3" selection-end-column="4" />
<folding />
</state>
</provider>
@ -51,7 +48,7 @@
<entry file="file://$PROJECT_DIR$/tamagotchi.py">
<provider selected="true" editor-type-id="text-editor">
<state vertical-scroll-proportion="0.0">
<caret line="12" column="9" selection-start-line="12" selection-start-column="9" selection-end-line="12" selection-end-column="9" />
<caret line="43" column="30" selection-start-line="43" selection-start-column="30" selection-end-line="43" selection-end-column="30" />
<folding />
</state>
</provider>
@ -65,9 +62,9 @@
<component name="IdeDocumentHistory">
<option name="CHANGED_PATHS">
<list>
<option value="$PROJECT_DIR$/pet_functions.py" />
<option value="$PROJECT_DIR$/tamagotchi.py" />
<option value="$PROJECT_DIR$/pet_variables.py" />
<option value="$PROJECT_DIR$/pet_functions.py" />
</list>
</option>
</component>
@ -75,8 +72,10 @@
<order />
</component>
<component name="ProjectFrameBounds">
<option name="width" value="1280" />
<option name="height" value="1024" />
<option name="x" value="1280" />
<option name="y" value="29" />
<option name="width" value="1680" />
<option name="height" value="1021" />
</component>
<component name="ProjectLevelVcsManager" settingsEditedManually="false">
<OptionsSetting value="true" id="Add" />
@ -101,6 +100,8 @@
<sortByType />
</navigator>
<panes>
<pane id="Scratches" />
<pane id="Scope" />
<pane id="ProjectPane">
<subPane>
<PATH>
@ -121,8 +122,6 @@
</PATH>
</subPane>
</pane>
<pane id="Scope" />
<pane id="Scratches" />
</panes>
</component>
<component name="PropertiesComponent">
@ -329,28 +328,28 @@
<servers />
</component>
<component name="ToolWindowManager">
<frame x="0" y="0" width="1280" height="1024" extended-state="6" />
<frame x="1280" y="29" width="1680" height="1021" extended-state="6" />
<editor active="false" />
<layout>
<window_info id="Messages" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="7" side_tool="false" content_ui="tabs" />
<window_info id="Terminal" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="7" side_tool="false" content_ui="tabs" />
<window_info id="TODO" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="6" side_tool="false" content_ui="tabs" />
<window_info id="Structure" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.25" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" />
<window_info id="Application Servers" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="7" side_tool="false" content_ui="tabs" />
<window_info id="Project" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" weight="0.328125" sideWeight="0.5" order="0" side_tool="false" content_ui="combo" />
<window_info id="Debug" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.4" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" />
<window_info id="Project" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" weight="0.3279762" sideWeight="0.5" order="0" side_tool="false" content_ui="combo" />
<window_info id="Python Console" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="7" side_tool="false" content_ui="tabs" />
<window_info id="Run" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.30989012" sideWeight="0.5" order="2" side_tool="false" content_ui="tabs" />
<window_info id="Favorites" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="2" side_tool="true" content_ui="tabs" />
<window_info id="Event Log" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="7" side_tool="true" content_ui="tabs" />
<window_info id="Version Control" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="7" side_tool="false" content_ui="tabs" />
<window_info id="Cvs" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.25" sideWeight="0.5" order="4" side_tool="false" content_ui="tabs" />
<window_info id="Message" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="0" side_tool="false" content_ui="tabs" />
<window_info id="Ant Build" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.25" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" />
<window_info id="Find" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" />
<window_info id="Ant Build" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.25" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" />
<window_info id="Debug" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.4" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" />
<window_info id="Messages" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="7" side_tool="false" content_ui="tabs" />
<window_info id="Commander" active="false" anchor="right" auto_hide="false" internal_type="SLIDING" type="SLIDING" visible="false" weight="0.4" sideWeight="0.5" order="0" side_tool="false" content_ui="tabs" />
<window_info id="Hierarchy" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.25" sideWeight="0.5" order="2" side_tool="false" content_ui="combo" />
<window_info id="Run" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.30989012" sideWeight="0.5" order="2" side_tool="false" content_ui="tabs" />
<window_info id="Inspection" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.4" sideWeight="0.5" order="5" side_tool="false" content_ui="tabs" />
<window_info id="Hierarchy" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.25" sideWeight="0.5" order="2" side_tool="false" content_ui="combo" />
</layout>
</component>
<component name="Vcs.Log.UiProperties">
@ -382,32 +381,6 @@
<provider selected="true" editor-type-id="text-editor">
<state vertical-scroll-proportion="0.0">
<caret line="0" column="0" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" />
<folding>
<element signature="e#0#20#0" expanded="true" />
</folding>
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/pet_variables.py">
<provider selected="true" editor-type-id="text-editor">
<state vertical-scroll-proportion="0.0">
<caret line="0" column="0" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/tamagotchi.py">
<provider selected="true" editor-type-id="text-editor">
<state vertical-scroll-proportion="0.0">
<caret line="0" column="0" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/tamagotchi.py">
<provider selected="true" editor-type-id="text-editor">
<state vertical-scroll-proportion="0.0">
<caret line="12" column="9" selection-start-line="12" selection-start-column="9" selection-end-line="12" selection-end-column="9" />
<folding />
</state>
</provider>
@ -420,13 +393,59 @@
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/tamagotchi.py">
<provider selected="true" editor-type-id="text-editor">
<state vertical-scroll-proportion="0.0">
<caret line="12" column="9" selection-start-line="12" selection-start-column="9" selection-end-line="12" selection-end-column="9" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/pet_functions.py">
<provider selected="true" editor-type-id="text-editor">
<state vertical-scroll-proportion="0.0">
<caret line="0" column="0" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" />
<folding>
<element signature="e#0#20#0" expanded="true" />
</folding>
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/pet_variables.py">
<provider selected="true" editor-type-id="text-editor">
<state vertical-scroll-proportion="0.0">
<caret line="0" column="0" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/tamagotchi.py">
<provider selected="true" editor-type-id="text-editor">
<state vertical-scroll-proportion="0.0">
<caret line="0" column="0" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/tamagotchi.py">
<provider selected="true" editor-type-id="text-editor">
<state vertical-scroll-proportion="0.0">
<caret line="43" column="30" selection-start-line="43" selection-start-column="30" selection-end-line="43" selection-end-column="30" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/pet_variables.py">
<provider selected="true" editor-type-id="text-editor">
<state vertical-scroll-proportion="0.0">
<caret line="3" column="4" selection-start-line="3" selection-start-column="4" selection-end-line="3" selection-end-column="4" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/pet_functions.py">
<provider selected="true" editor-type-id="text-editor">
<state vertical-scroll-proportion="-2.690205">
<caret line="20" column="0" selection-start-line="20" selection-start-column="0" selection-end-line="20" selection-end-column="0" />
<folding />
</state>
</provider>
</entry>

View File

@ -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')