From f0af033c97bd4069ff447d9394998a4c8c4cf15c Mon Sep 17 00:00:00 2001 From: Cezary Adamczak Date: Sun, 28 Mar 2021 23:51:45 +0200 Subject: [PATCH] =?UTF-8?q?Usu=C5=84=20'plant.py'?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- plant.py | 44 -------------------------------------------- 1 file changed, 44 deletions(-) delete mode 100644 plant.py diff --git a/plant.py b/plant.py deleted file mode 100644 index d297b5d..0000000 --- a/plant.py +++ /dev/null @@ -1,44 +0,0 @@ -import pygame -from colors import * -from dimensions import * -from sprites import * - -class Plant(pygame.sprite.Sprite): - def __init__(self, field, species): - super(Plant, self).__init__() - self.surf = plant_img_0 - self.position = field.position - self.field = field - self.rect = self.surf.get_rect( - topleft=((MARGIN + WIDTH) * self.position[0] + MARGIN, (MARGIN + HEIGHT) * self.position[1] + MARGIN)) - self.growth = 0 - self.isHealthy = True - self.species = species - if self.species == "beetroot": - self.growth_speed = 1.5 - self.humidity_needed = 2 - elif self.species == "wheat": - self.growth_speed = 1 - self.humidity_needed = 1 - elif self.species == "cotton": - self.growth_speed = 0.8 - self.humidity_needed = 1 - - - def grow(self): - if self.field.hydration >= self.humidity_needed: - self.growth += self.growth_speed - if self.field.hydration == 0: - self.growth -= self.growth_speed - if self.growth > 4: - self.growth = 4 - if self.growth < 0: - self.growth = 0 - if self.growth == 0: - self.surf = plant_img_0 - elif self.growth == 1: - self.surf = plant_img_1 - elif self.growth == 2: - self.surf = plant_img_2 - elif self.growth == 3: - self.surf = plant_img_3