added src catalog and plant class

This commit is contained in:
Milosz Rolewski 2023-03-19 19:47:09 +01:00
parent 10cf318d74
commit 31051bdd09

33
src/plant.py Normal file
View File

@ -0,0 +1,33 @@
from pygame.sprite import Sprite
class Plant(Sprite):
def __init__(self,species,location,is_ill,pic_path):
super.__init__()
self.species=species
self.location=location
self.is_ill=is_ill
if species=="carrot":
self.growth_time=100
self.weight=50
self.fertilizer="carrot_fertilizer"
self.pic_path="assets/Carrot.png"
if species=="beetroot":
self.growth_time=200
self.weight=200
self.fertilizer="beetroot_fertilizer"
self.pic_path="assets/Beetroot.png"
if species=="potato":
self.growth_time=100
self.weight=100
self.fertilizer="potatoe_fertilizer"
self.pic_path="assets/Potato.png"
if species=="wheat":
self.growth_time=250
self.weight=75
self.fertilizer="wheat_fertilizer"
self.pic_path="assets/Wheat.png"