From 31051bdd093366ee8fc8cf370798a34c4d39541b Mon Sep 17 00:00:00 2001 From: Milosz Rolewski Date: Sun, 19 Mar 2023 19:47:09 +0100 Subject: [PATCH] added src catalog and plant class --- src/plant.py | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 src/plant.py diff --git a/src/plant.py b/src/plant.py new file mode 100644 index 0000000..4926861 --- /dev/null +++ b/src/plant.py @@ -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" +