movement basics
Signed-off-by: Neerka <kuba.markil0220@gmail.com>
@ -26,6 +26,7 @@ class Garbagetruck:
|
||||
self.driver = None
|
||||
self.orientation = 3 # Niech numery będą tak: N - 0, W - 1, S - 2, E - 3 -- po prostu odwrotnie do zegara
|
||||
self.runningtime = 0
|
||||
self.movesequence = []
|
||||
|
||||
def getOrientation(self):
|
||||
return self.orientation
|
||||
@ -132,6 +133,13 @@ class Garbagetruck:
|
||||
dist = abs(lok1[0] - lok2[0]) + abs(lok1[1] - lok2[1])
|
||||
return dist
|
||||
|
||||
def selfdistance(self, target) -> int:
|
||||
lok = target.getPosition()
|
||||
own = self.getPosition()
|
||||
|
||||
dist = abs(lok[0] - own[0]) + abs(lok[1] - own[1])
|
||||
return dist
|
||||
|
||||
def scanTile(self):
|
||||
self.state = None
|
||||
temp = self.houses[:]
|
||||
@ -176,6 +184,28 @@ class Garbagetruck:
|
||||
stepX = 1
|
||||
self.modPosiotion(stepX, stepY)
|
||||
|
||||
def graphsearch(self, target):
|
||||
fringe = []
|
||||
explored = []
|
||||
result = []
|
||||
initial = self.getPosition()
|
||||
initial.append(self.getOrientation())
|
||||
fringe.append(tuple(initial))
|
||||
|
||||
while True:
|
||||
if not fringe:
|
||||
return False
|
||||
|
||||
elem = fringe.pop(0)
|
||||
if self.selfdistance(target) == 0:
|
||||
return result
|
||||
|
||||
explored.append(elem)
|
||||
|
||||
# KONIECZNIE SKOŃCZYĆ!!!
|
||||
|
||||
|
||||
|
||||
def classifyTrash(self):
|
||||
pass
|
||||
# Tutaj jest plan żeby dopiero napisać funkcję jak już będzie klasyfikator
|
||||
|
BIN
sprites/TIles/1 Tiles/FieldsTile_01.png
Normal file
After Width: | Height: | Size: 462 B |
BIN
sprites/TIles/1 Tiles/FieldsTile_02.png
Normal file
After Width: | Height: | Size: 515 B |
BIN
sprites/TIles/1 Tiles/FieldsTile_03.png
Normal file
After Width: | Height: | Size: 522 B |
BIN
sprites/TIles/1 Tiles/FieldsTile_04.png
Normal file
After Width: | Height: | Size: 530 B |
BIN
sprites/TIles/1 Tiles/FieldsTile_05.png
Normal file
After Width: | Height: | Size: 484 B |
BIN
sprites/TIles/1 Tiles/FieldsTile_06.png
Normal file
After Width: | Height: | Size: 560 B |
BIN
sprites/TIles/1 Tiles/FieldsTile_07.png
Normal file
After Width: | Height: | Size: 521 B |
BIN
sprites/TIles/1 Tiles/FieldsTile_08.png
Normal file
After Width: | Height: | Size: 591 B |
BIN
sprites/TIles/1 Tiles/FieldsTile_09.png
Normal file
After Width: | Height: | Size: 544 B |
BIN
sprites/TIles/1 Tiles/FieldsTile_10.png
Normal file
After Width: | Height: | Size: 541 B |
BIN
sprites/TIles/1 Tiles/FieldsTile_11.png
Normal file
After Width: | Height: | Size: 454 B |
BIN
sprites/TIles/1 Tiles/FieldsTile_12.png
Normal file
After Width: | Height: | Size: 571 B |
BIN
sprites/TIles/1 Tiles/FieldsTile_13.png
Normal file
After Width: | Height: | Size: 532 B |
BIN
sprites/TIles/1 Tiles/FieldsTile_14.png
Normal file
After Width: | Height: | Size: 540 B |
BIN
sprites/TIles/1 Tiles/FieldsTile_15.png
Normal file
After Width: | Height: | Size: 589 B |
BIN
sprites/TIles/1 Tiles/FieldsTile_16.png
Normal file
After Width: | Height: | Size: 512 B |
BIN
sprites/TIles/1 Tiles/FieldsTile_17.png
Normal file
After Width: | Height: | Size: 529 B |
BIN
sprites/TIles/1 Tiles/FieldsTile_18.png
Normal file
After Width: | Height: | Size: 456 B |
BIN
sprites/TIles/1 Tiles/FieldsTile_19.png
Normal file
After Width: | Height: | Size: 544 B |
BIN
sprites/TIles/1 Tiles/FieldsTile_20.png
Normal file
After Width: | Height: | Size: 464 B |
BIN
sprites/TIles/1 Tiles/FieldsTile_21.png
Normal file
After Width: | Height: | Size: 521 B |
BIN
sprites/TIles/1 Tiles/FieldsTile_22.png
Normal file
After Width: | Height: | Size: 580 B |
BIN
sprites/TIles/1 Tiles/FieldsTile_23.png
Normal file
After Width: | Height: | Size: 504 B |
BIN
sprites/TIles/1 Tiles/FieldsTile_24.png
Normal file
After Width: | Height: | Size: 613 B |
BIN
sprites/TIles/1 Tiles/FieldsTile_25.png
Normal file
After Width: | Height: | Size: 546 B |
BIN
sprites/TIles/1 Tiles/FieldsTile_26.png
Normal file
After Width: | Height: | Size: 559 B |
BIN
sprites/TIles/1 Tiles/FieldsTile_27.png
Normal file
After Width: | Height: | Size: 443 B |
BIN
sprites/TIles/1 Tiles/FieldsTile_28.png
Normal file
After Width: | Height: | Size: 592 B |
BIN
sprites/TIles/1 Tiles/FieldsTile_29.png
Normal file
After Width: | Height: | Size: 554 B |
BIN
sprites/TIles/1 Tiles/FieldsTile_30.png
Normal file
After Width: | Height: | Size: 584 B |
BIN
sprites/TIles/1 Tiles/FieldsTile_31.png
Normal file
After Width: | Height: | Size: 551 B |
BIN
sprites/TIles/1 Tiles/FieldsTile_32.png
Normal file
After Width: | Height: | Size: 571 B |
BIN
sprites/TIles/1 Tiles/FieldsTile_33.png
Normal file
After Width: | Height: | Size: 487 B |
BIN
sprites/TIles/1 Tiles/FieldsTile_34.png
Normal file
After Width: | Height: | Size: 519 B |
BIN
sprites/TIles/1 Tiles/FieldsTile_35.png
Normal file
After Width: | Height: | Size: 538 B |
BIN
sprites/TIles/1 Tiles/FieldsTile_36.png
Normal file
After Width: | Height: | Size: 531 B |
BIN
sprites/TIles/1 Tiles/FieldsTile_37.png
Normal file
After Width: | Height: | Size: 505 B |
BIN
sprites/TIles/1 Tiles/FieldsTile_38.png
Normal file
After Width: | Height: | Size: 139 B |
BIN
sprites/TIles/1 Tiles/FieldsTile_39.png
Normal file
After Width: | Height: | Size: 584 B |
BIN
sprites/TIles/1 Tiles/FieldsTile_40.png
Normal file
After Width: | Height: | Size: 588 B |
BIN
sprites/TIles/1 Tiles/FieldsTile_41.png
Normal file
After Width: | Height: | Size: 602 B |
BIN
sprites/TIles/1 Tiles/FieldsTile_42.png
Normal file
After Width: | Height: | Size: 599 B |
BIN
sprites/TIles/1 Tiles/FieldsTile_43.png
Normal file
After Width: | Height: | Size: 643 B |
BIN
sprites/TIles/1 Tiles/FieldsTile_44.png
Normal file
After Width: | Height: | Size: 597 B |
BIN
sprites/TIles/1 Tiles/FieldsTile_45.png
Normal file
After Width: | Height: | Size: 530 B |
BIN
sprites/TIles/1 Tiles/FieldsTile_46.png
Normal file
After Width: | Height: | Size: 535 B |
BIN
sprites/TIles/1 Tiles/FieldsTile_47.png
Normal file
After Width: | Height: | Size: 590 B |
BIN
sprites/TIles/1 Tiles/FieldsTile_48.png
Normal file
After Width: | Height: | Size: 626 B |
BIN
sprites/TIles/1 Tiles/FieldsTile_49.png
Normal file
After Width: | Height: | Size: 602 B |
BIN
sprites/TIles/1 Tiles/FieldsTile_50.png
Normal file
After Width: | Height: | Size: 593 B |
BIN
sprites/TIles/1 Tiles/FieldsTile_51.png
Normal file
After Width: | Height: | Size: 577 B |
BIN
sprites/TIles/1 Tiles/FieldsTile_52.png
Normal file
After Width: | Height: | Size: 580 B |
BIN
sprites/TIles/1 Tiles/FieldsTile_53.png
Normal file
After Width: | Height: | Size: 549 B |
BIN
sprites/TIles/1 Tiles/FieldsTile_54.png
Normal file
After Width: | Height: | Size: 529 B |
BIN
sprites/TIles/1 Tiles/FieldsTile_55.png
Normal file
After Width: | Height: | Size: 561 B |
BIN
sprites/TIles/1 Tiles/FieldsTile_56.png
Normal file
After Width: | Height: | Size: 555 B |
BIN
sprites/TIles/1 Tiles/FieldsTile_57.png
Normal file
After Width: | Height: | Size: 555 B |
BIN
sprites/TIles/1 Tiles/FieldsTile_58.png
Normal file
After Width: | Height: | Size: 554 B |
BIN
sprites/TIles/1 Tiles/FieldsTile_59.png
Normal file
After Width: | Height: | Size: 571 B |
BIN
sprites/TIles/1 Tiles/FieldsTile_60.png
Normal file
After Width: | Height: | Size: 551 B |
BIN
sprites/TIles/1 Tiles/FieldsTile_61.png
Normal file
After Width: | Height: | Size: 548 B |
BIN
sprites/TIles/1 Tiles/FieldsTile_62.png
Normal file
After Width: | Height: | Size: 537 B |
BIN
sprites/TIles/1 Tiles/FieldsTile_63.png
Normal file
After Width: | Height: | Size: 557 B |
BIN
sprites/TIles/1 Tiles/FieldsTile_64.png
Normal file
After Width: | Height: | Size: 545 B |
BIN
sprites/TIles/1 Tiles/FieldsTileset.png
Normal file
After Width: | Height: | Size: 6.7 KiB |
BIN
sprites/TIles/1 Tiles/FieldsTilesetTest.png
Normal file
After Width: | Height: | Size: 594 B |