agent
This commit is contained in:
commit
802d5f5b01
8
.idea/.gitignore
vendored
Normal file
8
.idea/.gitignore
vendored
Normal file
@ -0,0 +1,8 @@
|
||||
# Default ignored files
|
||||
/shelf/
|
||||
/workspace.xml
|
||||
# Editor-based HTTP Client requests
|
||||
/httpRequests/
|
||||
# Datasource local storage ignored files
|
||||
/dataSources/
|
||||
/dataSources.local.xml
|
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.10 (pythonPro)" 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/pythonPro.iml" filepath="$PROJECT_DIR$/.idea/pythonPro.iml" />
|
||||
</modules>
|
||||
</component>
|
||||
</project>
|
10
.idea/pythonPro.iml
Normal file
10
.idea/pythonPro.iml
Normal file
@ -0,0 +1,10 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<module type="PYTHON_MODULE" version="4">
|
||||
<component name="NewModuleRootManager">
|
||||
<content url="file://$MODULE_DIR$">
|
||||
<excludeFolder url="file://$MODULE_DIR$/venv" />
|
||||
</content>
|
||||
<orderEntry type="inheritedJdk" />
|
||||
<orderEntry type="sourceFolder" forTests="false" />
|
||||
</component>
|
||||
</module>
|
58
main.py
Normal file
58
main.py
Normal file
@ -0,0 +1,58 @@
|
||||
import pygame
|
||||
|
||||
pygame.init()
|
||||
|
||||
|
||||
screen_size = (600, 600)
|
||||
screen = pygame.display.set_mode(screen_size)
|
||||
|
||||
|
||||
square_size = 50
|
||||
num_squares = screen_size[0] // square_size
|
||||
|
||||
|
||||
squares = []
|
||||
for i in range(num_squares):
|
||||
row = []
|
||||
for j in range(num_squares):
|
||||
square_rect = pygame.Rect(j * square_size, i * square_size, square_size, square_size)
|
||||
row.append(square_rect)
|
||||
squares.append(row)
|
||||
|
||||
|
||||
object_rect = pygame.Rect(0, 0, square_size, square_size)
|
||||
|
||||
|
||||
running = True
|
||||
while running:
|
||||
|
||||
for event in pygame.event.get():
|
||||
if event.type == pygame.QUIT:
|
||||
running = False
|
||||
elif event.type == pygame.KEYDOWN:
|
||||
|
||||
if event.key == pygame.K_UP:
|
||||
if object_rect.top > 0:
|
||||
object_rect.top -= square_size
|
||||
elif event.key == pygame.K_DOWN:
|
||||
if object_rect.bottom < screen_size[1]:
|
||||
object_rect.top += square_size
|
||||
elif event.key == pygame.K_LEFT:
|
||||
if object_rect.left > 0:
|
||||
object_rect.left -= square_size
|
||||
elif event.key == pygame.K_RIGHT:
|
||||
if object_rect.right < screen_size[0]:
|
||||
object_rect.left += square_size
|
||||
|
||||
|
||||
screen.fill((255, 255, 255))
|
||||
|
||||
|
||||
for row in squares:
|
||||
for square_rect in row:
|
||||
pygame.draw.rect(screen, (0, 0, 0), square_rect, 1)
|
||||
|
||||
|
||||
pygame.draw.rect(screen, (255, 0, 0), object_rect)
|
||||
|
||||
pygame.display.flip()
|
Loading…
Reference in New Issue
Block a user