added multiple options for animals' images
@ -3,6 +3,16 @@ import pygame
|
|||||||
from abc import abstractmethod
|
from abc import abstractmethod
|
||||||
|
|
||||||
class Animal:
|
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,):
|
def __init__(self, x, y,name, image, food_image, food, environment, activity, ill=False, adult=False,):
|
||||||
self.x = x - 1
|
self.x = x - 1
|
||||||
self.y = y - 1
|
self.y = y - 1
|
||||||
|
@ -4,8 +4,8 @@ from datetime import datetime
|
|||||||
|
|
||||||
class Bat(Animal):
|
class Bat(Animal):
|
||||||
def __init__(self, x, y, adult=False):
|
def __init__(self, x, y, adult=False):
|
||||||
Bat_image = pygame.image.load('images/bat.png')
|
|
||||||
name = 'bat'
|
name = 'bat'
|
||||||
|
Bat_image = pygame.image.load(self.choose_picture(name))
|
||||||
environment = "medium"
|
environment = "medium"
|
||||||
food_image = 'images/grains.png'
|
food_image = 'images/grains.png'
|
||||||
parrot_food = 'grains'
|
parrot_food = 'grains'
|
||||||
|
@ -4,8 +4,8 @@ from datetime import datetime
|
|||||||
|
|
||||||
class Bear(Animal):
|
class Bear(Animal):
|
||||||
def __init__(self, x, y, adult=False):
|
def __init__(self, x, y, adult=False):
|
||||||
Bear_image = pygame.image.load('images/bear.png')
|
|
||||||
name = 'bear'
|
name = 'bear'
|
||||||
|
Bear_image = pygame.image.load(self.choose_picture(name))
|
||||||
environment = "cold"
|
environment = "cold"
|
||||||
activity = 'nocturnal'
|
activity = 'nocturnal'
|
||||||
ill = self.is_ill()
|
ill = self.is_ill()
|
||||||
|
@ -4,8 +4,8 @@ from datetime import datetime
|
|||||||
|
|
||||||
class Elephant(Animal):
|
class Elephant(Animal):
|
||||||
def __init__(self, x, y, adult=False):
|
def __init__(self, x, y, adult=False):
|
||||||
Elephant_image = pygame.image.load('images/elephant.png')
|
|
||||||
name = 'elephant'
|
name = 'elephant'
|
||||||
|
Elephant_image = pygame.image.load(self.choose_picture(name))
|
||||||
environment = "hot"
|
environment = "hot"
|
||||||
activity = 'diurnal'
|
activity = 'diurnal'
|
||||||
ill = self.is_ill()
|
ill = self.is_ill()
|
||||||
|
@ -4,8 +4,8 @@ from datetime import datetime
|
|||||||
|
|
||||||
class Giraffe(Animal):
|
class Giraffe(Animal):
|
||||||
def __init__(self, x, y, adult=False):
|
def __init__(self, x, y, adult=False):
|
||||||
Giraffe_image = pygame.image.load('images/giraffe.png')
|
|
||||||
name = 'giraffe'
|
name = 'giraffe'
|
||||||
|
Giraffe_image = pygame.image.load(self.choose_picture(name))
|
||||||
environment = "hot"
|
environment = "hot"
|
||||||
activity = 'diurnal'
|
activity = 'diurnal'
|
||||||
ill = self.is_ill()
|
ill = self.is_ill()
|
||||||
|
@ -4,8 +4,8 @@ from datetime import datetime
|
|||||||
|
|
||||||
class Owl(Animal):
|
class Owl(Animal):
|
||||||
def __init__(self, x, y, adult=False):
|
def __init__(self, x, y, adult=False):
|
||||||
Owl_image = pygame.image.load('images/owl.png')
|
|
||||||
name = 'owl'
|
name = 'owl'
|
||||||
|
Owl_image = pygame.image.load(self.choose_picture(name))
|
||||||
environment = "medium"
|
environment = "medium"
|
||||||
food_image = 'images/grains.png'
|
food_image = 'images/grains.png'
|
||||||
parrot_food = 'grains'
|
parrot_food = 'grains'
|
||||||
|
@ -4,8 +4,8 @@ from datetime import datetime
|
|||||||
|
|
||||||
class Parrot(Animal):
|
class Parrot(Animal):
|
||||||
def __init__(self, x, y, adult=False):
|
def __init__(self, x, y, adult=False):
|
||||||
Parrot_image = pygame.image.load('images/parrot.png')
|
|
||||||
name = 'parrot'
|
name = 'parrot'
|
||||||
|
Parrot_image = pygame.image.load(self.choose_picture(name))
|
||||||
environment = "medium"
|
environment = "medium"
|
||||||
activity = 'diurnal'
|
activity = 'diurnal'
|
||||||
ill = self.is_ill()
|
ill = self.is_ill()
|
||||||
|
@ -4,8 +4,8 @@ from datetime import datetime
|
|||||||
|
|
||||||
class Penguin(Animal):
|
class Penguin(Animal):
|
||||||
def __init__(self, x, y, adult=False):
|
def __init__(self, x, y, adult=False):
|
||||||
Penguin_image = pygame.image.load('images/penguin.png')
|
|
||||||
name = 'penguin'
|
name = 'penguin'
|
||||||
|
Penguin_image = pygame.image.load(self.choose_picture(name))
|
||||||
environment = "cold"
|
environment = "cold"
|
||||||
activity = 'diurnal'
|
activity = 'diurnal'
|
||||||
ill = self.is_ill()
|
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 |