Merge remote-tracking branch 'origin/master'
This commit is contained in:
commit
41272aea6e
2
.idea/.gitignore
vendored
Normal file
2
.idea/.gitignore
vendored
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
# Default ignored files
|
||||||
|
/workspace.xml
|
8
.idea/AI_PRO2.iml
Normal file
8
.idea/AI_PRO2.iml
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<module type="PYTHON_MODULE" version="4">
|
||||||
|
<component name="NewModuleRootManager">
|
||||||
|
<content url="file://$MODULE_DIR$" />
|
||||||
|
<orderEntry type="jdk" jdkName="Python 3.8 (AI_Tractor)" jdkType="Python SDK" />
|
||||||
|
<orderEntry type="sourceFolder" forTests="false" />
|
||||||
|
</component>
|
||||||
|
</module>
|
6
.idea/inspectionProfiles/profiles_settings.xml
Normal file
6
.idea/inspectionProfiles/profiles_settings.xml
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
<component name="InspectionProjectProfileManager">
|
||||||
|
<settings>
|
||||||
|
<option name="USE_PROJECT_PROFILE" value="false" />
|
||||||
|
<version value="1.0" />
|
||||||
|
</settings>
|
||||||
|
</component>
|
4
.idea/misc.xml
Normal file
4
.idea/misc.xml
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project version="4">
|
||||||
|
<component name="ProjectRootManager" version="2" project-jdk-name="Python 3.8 (AI_Tractor)" project-jdk-type="Python SDK" />
|
||||||
|
</project>
|
8
.idea/modules.xml
Normal file
8
.idea/modules.xml
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project version="4">
|
||||||
|
<component name="ProjectModuleManager">
|
||||||
|
<modules>
|
||||||
|
<module fileurl="file://$PROJECT_DIR$/.idea/AI_PRO2.iml" filepath="$PROJECT_DIR$/.idea/AI_PRO2.iml" />
|
||||||
|
</modules>
|
||||||
|
</component>
|
||||||
|
</project>
|
6
.idea/vcs.xml
Normal file
6
.idea/vcs.xml
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project version="4">
|
||||||
|
<component name="VcsDirectoryMappings">
|
||||||
|
<mapping directory="$PROJECT_DIR$" vcs="Git" />
|
||||||
|
</component>
|
||||||
|
</project>
|
35
drawUI.py
35
drawUI.py
@ -5,11 +5,11 @@ import pygame
|
|||||||
|
|
||||||
|
|
||||||
def drawUI(board, display, tractor, direction, tillageUnit, field):
|
def drawUI(board, display, tractor, direction, tillageUnit, field):
|
||||||
|
for i in range(1, 21):
|
||||||
display.fill(WHITE)
|
display.fill(WHITE)
|
||||||
makeField(board, display)
|
makeField(board, display)
|
||||||
drawTractor(display, tractor.horizontal_index, tractor.vertical_index, direction)
|
drawTractor(display, tractor.horizontal_index, tractor.vertical_index, direction, i)
|
||||||
drawInfo(display, tractor, tillageUnit, field)
|
drawInfo(display, tractor, tillageUnit, field)
|
||||||
|
|
||||||
pygame.display.update()
|
pygame.display.update()
|
||||||
|
|
||||||
|
|
||||||
@ -57,14 +57,25 @@ def makeField(board, screen: pygame.Surface):
|
|||||||
screen.blit(to_fertilizer, to_fertilizer_rect)
|
screen.blit(to_fertilizer, to_fertilizer_rect)
|
||||||
|
|
||||||
|
|
||||||
def drawTractor(screen: pygame.Surface, tractor_horizontal_index, tractor_vertical_index, direction):
|
def drawTractor(screen: pygame.Surface, tractor_horizontal_index, tractor_vertical_index, direction, i):
|
||||||
|
tractor_pic = tractor_up
|
||||||
|
horizontal = tractor_horizontal_index * TILE_SIZE
|
||||||
|
vertical = tractor_vertical_index * TILE_SIZE
|
||||||
|
|
||||||
|
|
||||||
|
i = i/10
|
||||||
|
|
||||||
if direction == "UP":
|
if direction == "UP":
|
||||||
screen.blit(tractor_up, (tractor_horizontal_index * TILE_SIZE, tractor_vertical_index * TILE_SIZE))
|
tractor_pic = tractor_up
|
||||||
elif direction == "DOWN":
|
vertical = vertical + (TILE_SIZE * i)
|
||||||
screen.blit(tractor_down, (tractor_horizontal_index * TILE_SIZE, tractor_vertical_index * TILE_SIZE))
|
if direction == "DOWN":
|
||||||
elif direction == "LEFT":
|
tractor_pic = tractor_down
|
||||||
screen.blit(tractor_left, (tractor_horizontal_index * TILE_SIZE, tractor_vertical_index * TILE_SIZE))
|
vertical = vertical - (TILE_SIZE * i)
|
||||||
elif direction == "RIGHT":
|
if direction == "LEFT":
|
||||||
screen.blit(tractor_right, (tractor_horizontal_index * TILE_SIZE, tractor_vertical_index * TILE_SIZE))
|
tractor_pic = tractor_left
|
||||||
else:
|
horizontal = horizontal + (TILE_SIZE * i)
|
||||||
screen.blit(tractor_right, (tractor_horizontal_index * TILE_SIZE, tractor_vertical_index * TILE_SIZE))
|
if direction == "RIGHT":
|
||||||
|
tractor_pic = tractor_right
|
||||||
|
horizontal = horizontal - (TILE_SIZE * i)
|
||||||
|
|
||||||
|
screen.blit(tractor_pic, (horizontal, vertical))
|
||||||
|
Loading…
Reference in New Issue
Block a user