diff --git a/Animals/animals.py b/Animals/animals.py index 39da79f..4823cd9 100644 --- a/Animals/animals.py +++ b/Animals/animals.py @@ -43,22 +43,20 @@ def create_animals(): def draw_Animals(Animals, const): for Animal in Animals: - Animal.draw(const.screen, const.GRID_SIZE) + + hunger_level = Animal.getting_hungry(const) - if Animal.getting_hungry(const) == 10: - Animal.draw_exclamation(const.screen, const.GRID_SIZE, Animal.x, Animal.y) - Animal.draw_food(const.screen,const.GRID_SIZE,Animal.x,Animal.y,'images/empty_bowl.png') + if hunger_level >= 9: + food_image = 'images/empty_bowl.png' + elif hunger_level >= 8: + food_image = 'images/almost_empty.png' + elif hunger_level >= 5: + food_image = 'images/half_bowl.png' + else: + food_image = 'images/full_bowl.png' - if Animal.getting_hungry(const) >= 8 and Animal.getting_hungry(const) < 5: - Animal.draw_exclamation(const.screen, const.GRID_SIZE, Animal.x, Animal.y) - Animal.draw_food(const.screen,const.GRID_SIZE,Animal.x,Animal.y,'images/almost_empty.png') - - if Animal.getting_hungry(const) >= 5 and Animal.getting_hungry(const) < 4: - Animal.draw_food(const.screen,const.GRID_SIZE,Animal.x,Animal.y,'images/half_bowl.png') - - if Animal.getting_hungry(const) < 5: - Animal.draw_food(const.screen,const.GRID_SIZE,Animal.x,Animal.y,'images/full_bowl.png') + Animal.draw_food(const.screen, const.GRID_SIZE, Animal.x, Animal.y, food_image) if Animal.ill: Animal.draw_illness(const.screen, const.GRID_SIZE, Animal.x, Animal.y) \ No newline at end of file diff --git a/Animals/bat.py b/Animals/bat.py index ea95b88..61e2dde 100644 --- a/Animals/bat.py +++ b/Animals/bat.py @@ -16,7 +16,7 @@ class Bat(Animal): def getting_hungry(self, const): checktime = datetime.now() delta = checktime - self._starttime - minutes_passed = delta.total_seconds() / 30 + minutes_passed = delta.total_seconds() / 30*5 self._starttime = checktime if const.IS_NIGHT and self._feed < 10: diff --git a/Animals/bear.py b/Animals/bear.py index 638449d..e292926 100644 --- a/Animals/bear.py +++ b/Animals/bear.py @@ -18,7 +18,7 @@ class Bear(Animal): checktime = datetime.now() delta = checktime - self._starttime - minutes_passed = delta.total_seconds() / 60 + minutes_passed = delta.total_seconds() / 60*5 self._starttime = checktime if const.IS_NIGHT and self._feed < 10 and const.season != "winter": diff --git a/Animals/elephant.py b/Animals/elephant.py index 3945208..d8b22b6 100644 --- a/Animals/elephant.py +++ b/Animals/elephant.py @@ -22,7 +22,7 @@ class Elephant(Animal): def getting_hungry(self, const): checktime = datetime.now() delta = checktime - self._starttime - minutes_passed = delta.total_seconds() / 50 + minutes_passed = delta.total_seconds() / 50*5 self._starttime = checktime if not const.IS_NIGHT and self._feed < 10: diff --git a/Animals/giraffe.py b/Animals/giraffe.py index 4bca926..926fcbc 100644 --- a/Animals/giraffe.py +++ b/Animals/giraffe.py @@ -17,7 +17,7 @@ class Giraffe(Animal): def getting_hungry(self, const): checktime = datetime.now() delta = checktime - self._starttime - minutes_passed = delta.total_seconds() / 30 + minutes_passed = delta.total_seconds() / 30*5 self._starttime = checktime if not const.IS_NIGHT and self._feed < 10: diff --git a/Animals/owl.py b/Animals/owl.py index 2829b7d..ef5bd69 100644 --- a/Animals/owl.py +++ b/Animals/owl.py @@ -16,7 +16,7 @@ class Owl(Animal): def getting_hungry(self, const): checktime = datetime.now() delta = checktime - self._starttime - minutes_passed = delta.total_seconds() / 25 + minutes_passed = delta.total_seconds() / 25*5 self._starttime = checktime if const.IS_NIGHT and self._feed < 10: diff --git a/Animals/parrot.py b/Animals/parrot.py index edef00d..02ce61d 100644 --- a/Animals/parrot.py +++ b/Animals/parrot.py @@ -17,7 +17,7 @@ class Parrot(Animal): def getting_hungry(self, const): checktime = datetime.now() delta = checktime - self._starttime - minutes_passed = delta.total_seconds() / 20 + minutes_passed = delta.total_seconds() / 20*5 self._starttime = checktime if not const.IS_NIGHT and self._feed < 10: diff --git a/Animals/penguin.py b/Animals/penguin.py index 2b566d7..17685ec 100644 --- a/Animals/penguin.py +++ b/Animals/penguin.py @@ -17,7 +17,7 @@ class Penguin(Animal): def getting_hungry(self, const): checktime = datetime.now() delta = checktime - self._starttime - minutes_passed = delta.total_seconds() / 15 + minutes_passed = delta.total_seconds() / 15*5 self._starttime = checktime if not const.IS_NIGHT and self._feed < 10: diff --git a/main.py b/main.py index 8cb96d6..a1d39f9 100644 --- a/main.py +++ b/main.py @@ -101,6 +101,7 @@ def main(): cost_map = generate_cost_map(Animals, Terrain_Obstacles) for animal in Animals: animal._feed = 0 + # animal._feed = random.randint(0, 10) spawned = True draw_Animals(Animals, const) diff --git a/tree.png b/tree.png index eb5ee72..4149e1c 100644 Binary files a/tree.png and b/tree.png differ