Poprawka w odświeżaniu mapy
This commit is contained in:
parent
dae93da39d
commit
440aab0adc
9
main.py
9
main.py
@ -2,6 +2,7 @@ import pygame
|
|||||||
import warehouse
|
import warehouse
|
||||||
import agent
|
import agent
|
||||||
import random
|
import random
|
||||||
|
import sys
|
||||||
from attributes import PackSize, PackStatus
|
from attributes import PackSize, PackStatus
|
||||||
|
|
||||||
WINDOW_SIZE = (600, 600)
|
WINDOW_SIZE = (600, 600)
|
||||||
@ -28,13 +29,17 @@ class MainGameFrame:
|
|||||||
self.display = pygame.display.set_mode(WINDOW_SIZE)
|
self.display = pygame.display.set_mode(WINDOW_SIZE)
|
||||||
self.warehouse_map = warehouse.Warehouse(20, 20, 150, 20)
|
self.warehouse_map = warehouse.Warehouse(20, 20, 150, 20)
|
||||||
starting_x, starting_y = self.set_starting_agent_position()
|
starting_x, starting_y = self.set_starting_agent_position()
|
||||||
self.agent = agent.Agent(starting_x, starting_y, self.warehouse_map ,20)
|
self.agent = agent.Agent(starting_x, starting_y, self.warehouse_map, 20)
|
||||||
|
|
||||||
def run(self):
|
def run(self):
|
||||||
|
while True:
|
||||||
|
for event in pygame.event.get():
|
||||||
|
if event.type == pygame.QUIT:
|
||||||
|
pygame.quit()
|
||||||
|
sys.exit()
|
||||||
self.draw_floor()
|
self.draw_floor()
|
||||||
self.draw_packages()
|
self.draw_packages()
|
||||||
self.draw_agent()
|
self.draw_agent()
|
||||||
while True:
|
|
||||||
pygame.display.update()
|
pygame.display.update()
|
||||||
|
|
||||||
def draw_floor(self):
|
def draw_floor(self):
|
||||||
|
Loading…
Reference in New Issue
Block a user