Male_zoo_Projekt_SI/Animals/penguin.py

26 lines
903 B
Python

from animal import Animal
import pygame
from datetime import datetime
class Penguin(Animal):
def __init__(self, x, y, adult=False):
Penguin_image = pygame.image.load('images/penguin.png')
name = 'penguin'
environment = "cold"
activity = 'diurnal'
ill = self.is_ill()
food_image = 'images/fish.png'
penguin_food = 'fish'
super().__init__(x, y, name, Penguin_image, food_image, penguin_food, environment, activity, ill, adult)
self._starttime = datetime.now()
def getting_hungry(self, const):
checktime = datetime.now()
delta = checktime - self._starttime
minutes_passed = delta.total_seconds() / 15
self._starttime = checktime
if not const.IS_NIGHT and self._feed < 10:
self._feed += minutes_passed
self._feed = min(self._feed, 10)
return self._feed