2022-03-07 20:41:12 +01:00
|
|
|
import os
|
|
|
|
|
2022-03-21 22:12:01 +01:00
|
|
|
from agent import *
|
2022-03-07 20:41:12 +01:00
|
|
|
|
2022-03-21 22:05:28 +01:00
|
|
|
Okno = pygame.display.set_mode((SZEROKOSC_OKNA, WYSOKOSC_OKNA))
|
2022-03-07 20:41:12 +01:00
|
|
|
pygame.display.set_caption("Okno1")
|
2022-03-21 22:05:28 +01:00
|
|
|
Krata = Krata(Okno)
|
2022-03-10 19:41:05 +01:00
|
|
|
|
2022-03-22 11:20:58 +01:00
|
|
|
|
2022-03-21 22:13:57 +01:00
|
|
|
#
|
2022-03-21 22:05:28 +01:00
|
|
|
def dodaj_agenta():
|
|
|
|
pole_lewe_gorne = PoleKraty(Krata, random.randint(0, LICZBA_POL_W_PIONIE - BOK_AGENTA1_W_POLACH),
|
|
|
|
random.randint(0, LICZBA_POL_W_POZIOMIE - BOK_AGENTA1_W_POLACH))
|
|
|
|
pom = 'test1_ikona.png'
|
|
|
|
ikona = pygame.transform.scale(pygame.image.load(os.path.join('Ikony', pom)),
|
|
|
|
(BOK_AGENTA1, BOK_AGENTA1))
|
2022-03-22 11:20:58 +01:00
|
|
|
Agent(Krata, pole_lewe_gorne, ikona)
|
2022-03-09 12:27:02 +01:00
|
|
|
|
|
|
|
|
2022-03-08 23:00:29 +01:00
|
|
|
def main():
|
2022-03-22 11:20:58 +01:00
|
|
|
dodaj_agenta()
|
2022-03-08 23:00:29 +01:00
|
|
|
klatkaz = pygame.time.Clock()
|
|
|
|
warunek_dzialania = True
|
|
|
|
while warunek_dzialania:
|
|
|
|
klatkaz.tick(FPS)
|
|
|
|
for event in pygame.event.get():
|
|
|
|
if event.type == pygame.QUIT:
|
|
|
|
warunek_dzialania = False
|
|
|
|
break
|
2022-03-21 22:05:28 +01:00
|
|
|
Krata.wyswietlKrate()
|
2022-03-08 23:00:29 +01:00
|
|
|
pygame.quit()
|
2022-03-08 18:38:43 +01:00
|
|
|
|
2022-03-07 20:41:12 +01:00
|
|
|
|
2022-03-08 23:00:29 +01:00
|
|
|
main()
|