diff --git a/bin/Classess/Field.py b/bin/Classess/Field.py index 1e6bc98..f600b71 100644 --- a/bin/Classess/Field.py +++ b/bin/Classess/Field.py @@ -17,13 +17,13 @@ step = IMAGE_SIZE + 3 class Field(object): def __init__(self): self.win = Tk() - self.width = 533 - self.height = 533 + self.width = 550 + self.height = 550 self.image_size = 50 self.rows = 10 self.columns = 10 - self.x_start = 3 - self.y_start = 3 + self.x_start = 5 + self.y_start = 5 self.state_of_cell_array = [[0 for i in range(3)] for j in range(200)] self.field_state_array = [[False for i in range(self.rows)] for j in range(self.columns)] self.small_image_array = [[0 for i in range(self.rows)] for j in range(self.columns)] diff --git a/bin/Classess/Node.py b/bin/Classess/Node.py index b592b51..2a2cd01 100644 --- a/bin/Classess/Node.py +++ b/bin/Classess/Node.py @@ -32,9 +32,9 @@ def successor(state): node_state_right.state.direction = "south" node_state_right.action = "Right" - if state.coord[0] + 53 < FRAME_WIDTH: + if state.coord[0] + STEP < FRAME_WIDTH: node_state_forward.state = State() - node_state_forward.state.coord = [state.coord[0] + 53, state.coord[1]] + node_state_forward.state.coord = [state.coord[0] + STEP, state.coord[1]] node_state_forward.state.direction = state.direction node_state_forward.action = "Up" @@ -50,9 +50,9 @@ def successor(state): node_state_right.state.direction = "north" node_state_right.action = "Right" - if state.coord[0] > 3: + if state.coord[0] > x_start: node_state_forward.state = State() - node_state_forward.state.coord = [state.coord[0] - 53, state.coord[1]] + node_state_forward.state.coord = [state.coord[0] - STEP, state.coord[1]] node_state_forward.state.direction = state.direction node_state_forward.action = "Up" @@ -68,9 +68,9 @@ def successor(state): node_state_right.state.direction = "east" node_state_right.action = "Right" - if state.coord[1] > 3: + if state.coord[1] > x_start: node_state_forward.state = State() - node_state_forward.state.coord = [state.coord[0], state.coord[1] - 53] + node_state_forward.state.coord = [state.coord[0], state.coord[1] - STEP] node_state_forward.state.direction = state.direction node_state_forward.action = "Up" @@ -86,9 +86,9 @@ def successor(state): node_state_right.state.direction = "west" node_state_right.action = "Right" - if state.coord[1] + 53 < FRAME_HEIGHT: + if state.coord[1] + STEP < FRAME_HEIGHT: node_state_forward.state = State() - node_state_forward.state.coord = [state.coord[0], state.coord[1] + 53] + node_state_forward.state.coord = [state.coord[0], state.coord[1] + STEP] node_state_forward.state.direction = state.direction node_state_forward.action = "Up" diff --git a/bin/Classess/Player.py b/bin/Classess/Player.py index 9c9ac5f..a25cc10 100644 --- a/bin/Classess/Player.py +++ b/bin/Classess/Player.py @@ -11,8 +11,8 @@ from resources.Globals import * class Player(object): def __init__(self): - self.x_start = 3 - self.y_start = 3 + self.x_start = 5 + self.y_start = 5 self.current_x = self.x_start self.current_y = self.y_start self.step = IMAGE_SIZE + self.x_start diff --git a/bin/Classess/__pycache__/Field.cpython-37.pyc b/bin/Classess/__pycache__/Field.cpython-37.pyc index da8182a..1691485 100644 Binary files a/bin/Classess/__pycache__/Field.cpython-37.pyc and b/bin/Classess/__pycache__/Field.cpython-37.pyc differ diff --git a/bin/Classess/__pycache__/Node.cpython-37.pyc b/bin/Classess/__pycache__/Node.cpython-37.pyc index 80a170c..389d560 100644 Binary files a/bin/Classess/__pycache__/Node.cpython-37.pyc and b/bin/Classess/__pycache__/Node.cpython-37.pyc differ diff --git a/bin/Classess/__pycache__/Player.cpython-37.pyc b/bin/Classess/__pycache__/Player.cpython-37.pyc index 033b057..597166b 100644 Binary files a/bin/Classess/__pycache__/Player.cpython-37.pyc and b/bin/Classess/__pycache__/Player.cpython-37.pyc differ diff --git a/bin/main/main.py b/bin/main/main.py index 99d7aa1..13e9c92 100644 --- a/bin/main/main.py +++ b/bin/main/main.py @@ -184,7 +184,6 @@ def MouseClickEvent(event): end_position = [] # print("Pierwsza pozycja: {} {}".format(start_position[0], start_position[1])) - print(field.canvas_small_images) for i in range(0, len(field.canvas_small_images)): img_coords = field.small_field_canvas.coords(field.canvas_small_images[i]) @@ -307,8 +306,8 @@ def AutoMove(): # Draws rectangles that indicate type of cells def DrawRectangle(): - x = player.x_start - y = player.y_start + x = 4 + y = 4 color = None @@ -323,10 +322,10 @@ def DrawRectangle(): elif field.cell_expense[i] == 40: color = "green4" if color != "None": - field.small_field_canvas.create_rectangle(x, y, x + IMAGE_SIZE, y + IMAGE_SIZE, width=3, outline=color) + field.small_field_canvas.create_rectangle(x, y, x + IMAGE_SIZE + 2, y + IMAGE_SIZE + 2, width=2, outline=color) x += player.step if i > 0 and i % 10 == 0: - x = player.x_start + x = 4 y += player.step diff --git a/resources/Globals.py b/resources/Globals.py index 86dc1db..f8cc7ff 100644 --- a/resources/Globals.py +++ b/resources/Globals.py @@ -1,7 +1,8 @@ -WINDOW_X = 533 + 1200 +FRAME_WIDTH = 555 +FRAME_HEIGHT = 555 + +WINDOW_X = FRAME_WIDTH + 1200 WINDOW_Y = 950 -FRAME_WIDTH = 533 -FRAME_HEIGHT = 533 # Size of small image IMAGE_SIZE = 50 @@ -10,6 +11,7 @@ AMOUNT_OF_MINES = 10 DELAY_TIME = 0.5 +STEP = IMAGE_SIZE + 5 standard_cell_cost = 10 @@ -21,3 +23,8 @@ water_cell_cost = 30 amount_of_swamp_cells = 10 swamp_cell_cost = 40 + + + +x_start = 5 +y_start = 5 diff --git a/resources/__pycache__/Globals.cpython-37.pyc b/resources/__pycache__/Globals.cpython-37.pyc index ad2a2f1..3f61adc 100644 Binary files a/resources/__pycache__/Globals.cpython-37.pyc and b/resources/__pycache__/Globals.cpython-37.pyc differ