464921 #4
BIN
dot-22-433567.png
Normal file
BIN
dot-22-433567.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 5.0 KiB |
10
main.py
10
main.py
@ -3,20 +3,26 @@ import pygame
|
|||||||
WIDTH, HEIGHT = 800, 800
|
WIDTH, HEIGHT = 800, 800
|
||||||
WIN = pygame.display.set_mode((WIDTH, HEIGHT))
|
WIN = pygame.display.set_mode((WIDTH, HEIGHT))
|
||||||
pygame.display.set_caption("Sztuczna Inteligencja")
|
pygame.display.set_caption("Sztuczna Inteligencja")
|
||||||
|
FPS = 30
|
||||||
|
AGENT_IMG = pygame.image.load("dot-22-433567.png")
|
||||||
|
AGENT = pygame.transform.scale(AGENT_IMG, (50, 50))
|
||||||
|
|
||||||
|
|
||||||
def draw_window():
|
def draw_window(agent):
|
||||||
WIN.fill((255,255,255))
|
WIN.fill((255,255,255))
|
||||||
|
WIN.blit(AGENT, (agent.x, agent.y))
|
||||||
pygame.display.update()
|
pygame.display.update()
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
|
clock = pygame.time.Clock()
|
||||||
run = True
|
run = True
|
||||||
|
agent = pygame.Rect(0, 0, 50, 50)
|
||||||
|
|
||||||
while run:
|
while run:
|
||||||
for event in pygame.event.get():
|
for event in pygame.event.get():
|
||||||
if event.type == pygame.QUIT:
|
if event.type == pygame.QUIT:
|
||||||
run = False
|
run = False
|
||||||
draw_window()
|
draw_window(agent)
|
||||||
|
|
||||||
pygame.quit()
|
pygame.quit()
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user