diff --git a/.idea/workspace.xml b/.idea/workspace.xml
index cde8c29..7663586 100644
--- a/.idea/workspace.xml
+++ b/.idea/workspace.xml
@@ -5,26 +5,6 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
@@ -115,6 +95,7 @@
+
@@ -122,44 +103,44 @@
-
+
-
-
+
+
-
-
+
+
-
-
+
+
-
-
+
+
-
-
+
+
-
-
+
+
-
-
+
+
-
-
+
+
-
+
-
+
\ No newline at end of file
diff --git a/__pycache__/definitions.cpython-37.pyc b/__pycache__/definitions.cpython-37.pyc
index 577de20..95a1261 100644
Binary files a/__pycache__/definitions.cpython-37.pyc and b/__pycache__/definitions.cpython-37.pyc differ
diff --git a/definitions.py b/definitions.py
index e3304c2..dc707e2 100644
--- a/definitions.py
+++ b/definitions.py
@@ -1,6 +1,6 @@
import os
import pygame
-BLOCK_SIZE = 100
+BLOCK_SIZE = 60
BEETROOTS_GROW_TIME = 5
BEETROOTS_MAXIMUM_STATE = BEETROOTS_GROW_TIME * 3 + 1
BEETROOTS_STAGE_0 = pygame.image.load(os.path.join('resources', 'beetroots_stage_0.png'))
@@ -23,6 +23,8 @@ CARROTS_STAGE_3 = pygame.image.load(os.path.join('resources', 'carrots_stage_3.p
CARROTS_STAGE_3 = pygame.transform.scale(CARROTS_STAGE_3, (BLOCK_SIZE, BLOCK_SIZE))
DIRT = pygame.image.load(os.path.join('resources', 'dirt.png'))
DIRT = pygame.transform.scale(DIRT, (BLOCK_SIZE, BLOCK_SIZE))
+HEIGHT_AMOUNT, WIDTH_AMOUNT = 10, 10
+HEIGHT, WIDTH = BLOCK_SIZE * HEIGHT_AMOUNT, BLOCK_SIZE * WIDTH_AMOUNT
FARMLAND_DRY = pygame.image.load(os.path.join('resources', 'farmland_dry.png'))
FARMLAND_DRY = pygame.transform.scale(FARMLAND_DRY, (BLOCK_SIZE, BLOCK_SIZE))
FARMLAND_WET = pygame.image.load(os.path.join('resources', 'farmland_wet.png'))
@@ -38,7 +40,6 @@ POTATOES_STAGE_2 = pygame.image.load(os.path.join('resources', 'potatoes_stage_2
POTATOES_STAGE_2 = pygame.transform.scale(POTATOES_STAGE_2, (BLOCK_SIZE, BLOCK_SIZE))
POTATOES_STAGE_3 = pygame.image.load(os.path.join('resources', 'potatoes_stage_3.png'))
POTATOES_STAGE_3 = pygame.transform.scale(POTATOES_STAGE_3, (BLOCK_SIZE, BLOCK_SIZE))
-WIDTH, HEIGHT = 1000, 1000
WINDOW = pygame.display.set_mode((WIDTH, HEIGHT))
TRACTOR = pygame.image.load(os.path.join('resources', 'minecart_command_block.png'))
TRACTOR = pygame.transform.scale(TRACTOR, (BLOCK_SIZE, BLOCK_SIZE))
diff --git a/py.py b/py.py
index dc9f3d3..f20cbc3 100644
--- a/py.py
+++ b/py.py
@@ -8,9 +8,9 @@ import tractor
pygame.display.set_caption("Smart Tractor")
fields = []
def create_base_map():
- for i in range(10):
+ for i in range(definitions.WIDTH_AMOUNT):
temp_map_field = []
- for j in range(10):
+ for j in range(definitions.HEIGHT_AMOUNT):
temp_rect = pygame.Rect(i * definitions.BLOCK_SIZE, j * definitions.BLOCK_SIZE, definitions.BLOCK_SIZE, definitions.BLOCK_SIZE)
temp_soil = soil.Soil(False, False, False)
temp_plant = plant.Plant("none", 0)
@@ -18,8 +18,8 @@ def create_base_map():
temp_map_field.append(temp_field)
fields.append(temp_map_field)
def fill_map():
- for i in range(10):
- for j in range(10):
+ for i in range(definitions.WIDTH_AMOUNT):
+ for j in range(definitions.HEIGHT_AMOUNT):
field = fields[i][j]
rect = field.get_rect()
if field.get_plant().get_name() == "beetroot" and field.get_plant().get_state() > 0 and field.get_plant().get_state() <= 1 * definitions.BEETROOTS_GROW_TIME:
@@ -75,8 +75,8 @@ def do_work(tractor1, tractor1_rect):
loop = True
if tractor1.get_all_amount_of_seeds() == 0:
loop = False
- x = int(tractor1_rect.x / 100)
- y = int(tractor1_rect.y / 100)
+ x = int(tractor1_rect.x / definitions.BLOCK_SIZE)
+ y = int(tractor1_rect.y / definitions.BLOCK_SIZE)
field = fields[x][y]
if field.get_soil().get_state() is False:
field.get_soil().set_state(True)
@@ -151,8 +151,8 @@ def draw_window(tractor1_rect):
definitions.WINDOW.blit(definitions.TRACTOR, (tractor1_rect.x, tractor1_rect.y))
pygame.display.update()
def grow_plants():
- for i in range(10):
- for j in range(10):
+ for i in range(definitions.WIDTH_AMOUNT):
+ for j in range(definitions.HEIGHT_AMOUNT):
field = fields[i][j]
if field.get_plant().get_name() == "beetroot" and field.get_plant().get_state() > 0 and field.get_plant().get_state() < definitions.BEETROOTS_MAXIMUM_STATE:
field.get_plant().set_state(field.get_plant().get_state() + 1)