Usuń 'field.py'
This commit is contained in:
parent
20347ed4eb
commit
7d8b06e6aa
43
field.py
43
field.py
@ -1,43 +0,0 @@
|
|||||||
import pygame
|
|
||||||
from colors import *
|
|
||||||
from dimensions import *
|
|
||||||
|
|
||||||
class Field(pygame.sprite.Sprite):
|
|
||||||
def __init__(self, row, column):
|
|
||||||
super(Field, self).__init__()
|
|
||||||
self.surf = pygame.Surface((WIDTH, HEIGHT))
|
|
||||||
self.surf.fill(BROWN)
|
|
||||||
self.rect = self.surf.get_rect(
|
|
||||||
topleft=((MARGIN + WIDTH) * row + MARGIN, (MARGIN + HEIGHT) * column + MARGIN))
|
|
||||||
self.position = [row, column]
|
|
||||||
self.hydration = 0
|
|
||||||
self.isRocky = False
|
|
||||||
self.planted = 0
|
|
||||||
self.ferility = 1
|
|
||||||
|
|
||||||
def hydrate(self):
|
|
||||||
if self.hydration <= 3:
|
|
||||||
self.hydration += 1
|
|
||||||
if self.hydration == 0:
|
|
||||||
self.surf.fill(BROWN)
|
|
||||||
if self.hydration == 1:
|
|
||||||
self.surf.fill(YELLOW)
|
|
||||||
if self.hydration == 2:
|
|
||||||
self.surf.fill(GREEN)
|
|
||||||
if self.hydration == 3:
|
|
||||||
self.surf.fill(BLUE)
|
|
||||||
|
|
||||||
def dehydrate(self):
|
|
||||||
if self.hydration > 0:
|
|
||||||
self.hydration -= 1
|
|
||||||
if self.hydration == 0:
|
|
||||||
self.surf.fill(BROWN)
|
|
||||||
if self.hydration == 1:
|
|
||||||
self.surf.fill(YELLOW)
|
|
||||||
if self.hydration == 2:
|
|
||||||
self.surf.fill(GREEN)
|
|
||||||
if self.hydration == 3:
|
|
||||||
self.surf.fill(BLUE)
|
|
||||||
|
|
||||||
def free(self):
|
|
||||||
self.planted = 0
|
|
Loading…
Reference in New Issue
Block a user