Male_zoo_Projekt_SI/Animals/parrot.py

27 lines
787 B
Python

from animal import Animal
import pygame
from datetime import datetime
class Parrot(Animal):
def __init__(self, x, y, adult=False):
Parrot_image = pygame.image.load('images/parrot.png')
name = 'parrot'
environment = "medium"
food_image = 'images/grains.png'
parrot_food = 'grains'
super().__init__(x, y,name, Parrot_image, food_image,parrot_food, environment, adult)
self._starttime = datetime.now()
def getting_hungry(self):
checktime = datetime.now()
delta = checktime - self._starttime
minutes_passed = delta.total_seconds() / 20
self._feed += minutes_passed
self._starttime = checktime
if self._feed > 5:
self._feed = 5
return self._feed