added multiple options for animals' images
@ -3,6 +3,16 @@ import pygame
|
||||
from abc import abstractmethod
|
||||
|
||||
class Animal:
|
||||
|
||||
def choose_picture(self, name):
|
||||
ran = random.randint(0, 1)
|
||||
if ran == 0:
|
||||
path = f'images/{name}.png'
|
||||
return path
|
||||
else:
|
||||
path = f'images/{name}2.png'
|
||||
return path
|
||||
|
||||
def __init__(self, x, y,name, image, food_image, food, environment, activity, ill=False, adult=False,):
|
||||
self.x = x - 1
|
||||
self.y = y - 1
|
||||
|
@ -4,8 +4,8 @@ from datetime import datetime
|
||||
|
||||
class Bat(Animal):
|
||||
def __init__(self, x, y, adult=False):
|
||||
Bat_image = pygame.image.load('images/bat.png')
|
||||
name = 'bat'
|
||||
Bat_image = pygame.image.load(self.choose_picture(name))
|
||||
environment = "medium"
|
||||
food_image = 'images/grains.png'
|
||||
parrot_food = 'grains'
|
||||
|
@ -4,8 +4,8 @@ from datetime import datetime
|
||||
|
||||
class Bear(Animal):
|
||||
def __init__(self, x, y, adult=False):
|
||||
Bear_image = pygame.image.load('images/bear.png')
|
||||
name = 'bear'
|
||||
Bear_image = pygame.image.load(self.choose_picture(name))
|
||||
environment = "cold"
|
||||
activity = 'nocturnal'
|
||||
ill = self.is_ill()
|
||||
|
@ -4,8 +4,8 @@ from datetime import datetime
|
||||
|
||||
class Elephant(Animal):
|
||||
def __init__(self, x, y, adult=False):
|
||||
Elephant_image = pygame.image.load('images/elephant.png')
|
||||
name = 'elephant'
|
||||
Elephant_image = pygame.image.load(self.choose_picture(name))
|
||||
environment = "hot"
|
||||
activity = 'diurnal'
|
||||
ill = self.is_ill()
|
||||
|
@ -4,8 +4,8 @@ from datetime import datetime
|
||||
|
||||
class Giraffe(Animal):
|
||||
def __init__(self, x, y, adult=False):
|
||||
Giraffe_image = pygame.image.load('images/giraffe.png')
|
||||
name = 'giraffe'
|
||||
Giraffe_image = pygame.image.load(self.choose_picture(name))
|
||||
environment = "hot"
|
||||
activity = 'diurnal'
|
||||
ill = self.is_ill()
|
||||
|
@ -4,8 +4,8 @@ from datetime import datetime
|
||||
|
||||
class Owl(Animal):
|
||||
def __init__(self, x, y, adult=False):
|
||||
Owl_image = pygame.image.load('images/owl.png')
|
||||
name = 'owl'
|
||||
Owl_image = pygame.image.load(self.choose_picture(name))
|
||||
environment = "medium"
|
||||
food_image = 'images/grains.png'
|
||||
parrot_food = 'grains'
|
||||
|
@ -4,8 +4,8 @@ from datetime import datetime
|
||||
|
||||
class Parrot(Animal):
|
||||
def __init__(self, x, y, adult=False):
|
||||
Parrot_image = pygame.image.load('images/parrot.png')
|
||||
name = 'parrot'
|
||||
Parrot_image = pygame.image.load(self.choose_picture(name))
|
||||
environment = "medium"
|
||||
activity = 'diurnal'
|
||||
ill = self.is_ill()
|
||||
|
@ -4,8 +4,8 @@ from datetime import datetime
|
||||
|
||||
class Penguin(Animal):
|
||||
def __init__(self, x, y, adult=False):
|
||||
Penguin_image = pygame.image.load('images/penguin.png')
|
||||
name = 'penguin'
|
||||
Penguin_image = pygame.image.load(self.choose_picture(name))
|
||||
environment = "cold"
|
||||
activity = 'diurnal'
|
||||
ill = self.is_ill()
|
||||
|
BIN
images/bat.png
Before Width: | Height: | Size: 740 KiB After Width: | Height: | Size: 458 KiB |
BIN
images/bat2.png
Normal file
After Width: | Height: | Size: 438 KiB |
BIN
images/bear2.png
Normal file
After Width: | Height: | Size: 366 KiB |
BIN
images/elephant2.png
Normal file
After Width: | Height: | Size: 294 KiB |
BIN
images/giraffe2.png
Normal file
After Width: | Height: | Size: 1.7 MiB |
BIN
images/owl.png
Before Width: | Height: | Size: 286 KiB After Width: | Height: | Size: 178 KiB |
BIN
images/owl2.png
Normal file
After Width: | Height: | Size: 1.5 MiB |
BIN
images/parrot2.png
Normal file
After Width: | Height: | Size: 268 KiB |
BIN
images/penguin2.png
Normal file
After Width: | Height: | Size: 176 KiB |