From 2db4051e5b2a7e342c73b9df2b612aa9fec409af Mon Sep 17 00:00:00 2001 From: Andrzej Date: Sat, 1 May 2021 01:24:35 +0200 Subject: [PATCH] GUI changes --- bin/Classess/Field.py | 8 ++++---- bin/Classess/Node.py | 16 ++++++++-------- bin/Classess/Player.py | 4 ++-- bin/Classess/__pycache__/Field.cpython-37.pyc | Bin 3313 -> 3318 bytes bin/Classess/__pycache__/Node.cpython-37.pyc | Bin 2709 -> 2714 bytes .../__pycache__/Player.cpython-37.pyc | Bin 1811 -> 1811 bytes bin/main/main.py | 9 ++++----- resources/Globals.py | 13 ++++++++++--- resources/__pycache__/Globals.cpython-37.pyc | Bin 479 -> 534 bytes 9 files changed, 28 insertions(+), 22 deletions(-) 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 da8182a637b5d0c3c531f2087aedbb3773a45cef..1691485dcf3af2eadda837b6a79f22d5a8ab6a06 100644 GIT binary patch delta 706 zcmew;`Aw3`iI z(ID3N$+c__M7a1Kn+=;V$Ymmv71*W4Getq6F9H@blBEiYk?DC9!i)XVl3cub2Z!@Gx?4aWHW(0{{`EbXEWW delta 747 zcmew+`B9R~iIw?i(zW{K>8SOu@tA~q(MxE z7zz}YncT=GKDm!2kqE;DSRHggh8GEd%!9fEVs?=rNF3}OxY4pOqg4sI8>m@sGB1mb z2C>FZu4Qu|!o~O4Y}kZAE)$-tz%K3ZQUu7(Y+(k4PkK>e-FpDvT1E`jD0%P7TkXQ=moYW4HM8=j47-&O!2HR$AZ1Y znawcSk3~`uY=Sse6F?p);hHSRs?NwY*^O00fDsrnx0pf;Zn2c77MEypPwrrqmu3kL qaSgb|?H1(d>lz>K=@Q~`i@hSgxFoTtWb-FpDvT6R4JT0%P7TkXQ=WoYG4HM8=j47-&O!2HR$AZ1Y zp3N}Xk3~`uY=Sse6F?p);g~GPs?NwW*^O00$`lwfFByTvEvC?dTP)?N#U(G9fm}__ i$#tyqJlt+Uj=rw(;hrub9-DWtdNDIfY-Z-1&IkagoJ?c@ diff --git a/bin/Classess/__pycache__/Player.cpython-37.pyc b/bin/Classess/__pycache__/Player.cpython-37.pyc index 033b05783c72a1a0af222cbbfe459c568bc8ad60..597166bfd18bf4ecb8a8079942b17ef04f23717e 100644 GIT binary patch delta 26 gcmbQtH<^#iiI 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 ad2a2f18733d051587bd738a47f26cc13fadb2a9..3f61adc1b5fc8655f772712dc15abdf52f845c8d 100644 GIT binary patch delta 292 zcmcc5JdLH^iIlMWC34g%JQ^ra8v| delta 244 zcmbQna-X^0iI#LOwo zQ7kDeQLHJfQEWh(9f&zn*rGUrG*=3H6gQCON#Tg%P2mh?(B#TI%ErKuxs4e}h%zxS zyfgxu_>zl3mVqH1$O3`~_Af<%)Jr)Kp#dcPH2Ef85S8L~3v%>zjSu&93Guka1L1hM sdb)drOnjm_S(velb0tF&NN17A