Male_zoo_Projekt_SI/Animals/animals.py

64 lines
2.3 KiB
Python
Raw Normal View History

2024-04-27 19:50:18 +02:00
from elephant import Elephant
from giraffe import Giraffe
from penguin import Penguin
from parrot import Parrot
from bear import Bear
from owl import Owl
from bat import Bat
2024-04-27 19:50:18 +02:00
def create_animals():
giraffe1 = Giraffe(0, 0, adult=True)
giraffe2 = Giraffe(0, 0, adult=True)
giraffe3 = Giraffe(0, 0, adult=True)
giraffe4 = Giraffe(0, 0)
giraffe5 = Giraffe(0, 0)
bear1 = Bear(0, 0, adult=True)
bear2 = Bear(0, 0, adult=True)
bear3 = Bear(0, 0)
bear4 = Bear(0, 0)
bear5 = Bear(0, 0)
penguin1 = Penguin(0, 0)
penguin2 = Penguin(0, 0)
penguin3 = Penguin(0, 0)
penguin4 = Penguin(0, 0)
elephant1 = Elephant(0, 0, adult=True)
elephant2 = Elephant(0, 0, adult=True)
elephant3 = Elephant(0, 0)
elephant4 = Elephant(0, 0)
elephant5 = Elephant(0, 0)
parrot1 = Parrot(0, 0)
parrot2 = Parrot(0, 0)
owl1 = Owl(0, 0)
owl2 = Owl(0, 0)
bat1 = Bat(0, 0)
bat2 = Bat(0, 0)
2024-04-27 19:50:18 +02:00
Animals = [giraffe1, giraffe2, giraffe3, giraffe4, giraffe5,
bear1, bear2, bear3, bear4, bear5,
elephant1, elephant2, elephant3, elephant4, elephant5,
penguin1, penguin2, penguin3, penguin4,
parrot1, parrot2, owl1, owl2, bat1, bat2]
2024-04-27 19:50:18 +02:00
return Animals
def draw_Animals(Animals, const):
for Animal in Animals:
Animal.draw(const.screen, const.GRID_SIZE)
2024-05-12 16:25:09 +02:00
if Animal.getting_hungry(const) == 10:
Animal.draw_exclamation(const.screen, const.GRID_SIZE, Animal.x, Animal.y)
2024-05-10 01:56:12 +02:00
Animal.draw_food(const.screen,const.GRID_SIZE,Animal.x,Animal.y,'images/empty_bowl.png')
2024-05-12 16:25:09 +02:00
if Animal.getting_hungry(const) >= 8 and Animal.getting_hungry(const) < 5:
2024-05-10 01:56:12 +02:00
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')
2024-05-12 16:25:09 +02:00
if Animal.getting_hungry(const) >= 5 and Animal.getting_hungry(const) < 4:
2024-05-10 01:56:12 +02:00
Animal.draw_food(const.screen,const.GRID_SIZE,Animal.x,Animal.y,'images/half_bowl.png')
2024-05-12 16:25:09 +02:00
if Animal.getting_hungry(const) < 5:
Animal.draw_food(const.screen,const.GRID_SIZE,Animal.x,Animal.y,'images/full_bowl.png')
if Animal.ill:
Animal.draw_illness(const.screen, const.GRID_SIZE, Animal.x, Animal.y)