commit 93d4b3018aa4777dda639cd1bbc21d1dc4bf3da5 Author: Dominik Date: Mon Mar 7 20:41:12 2022 +0100 Pierwsze próby poznania pygame. diff --git a/.idea/.gitignore b/.idea/.gitignore new file mode 100644 index 0000000..26d3352 --- /dev/null +++ b/.idea/.gitignore @@ -0,0 +1,3 @@ +# Default ignored files +/shelf/ +/workspace.xml diff --git a/.idea/Sztuczna_Inteligencja_Gr16.iml b/.idea/Sztuczna_Inteligencja_Gr16.iml new file mode 100644 index 0000000..f754d4e --- /dev/null +++ b/.idea/Sztuczna_Inteligencja_Gr16.iml @@ -0,0 +1,10 @@ + + + + + + + + + + \ No newline at end of file diff --git a/.idea/inspectionProfiles/profiles_settings.xml b/.idea/inspectionProfiles/profiles_settings.xml new file mode 100644 index 0000000..105ce2d --- /dev/null +++ b/.idea/inspectionProfiles/profiles_settings.xml @@ -0,0 +1,6 @@ + + + + \ No newline at end of file diff --git a/.idea/misc.xml b/.idea/misc.xml new file mode 100644 index 0000000..89fb180 --- /dev/null +++ b/.idea/misc.xml @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/.idea/modules.xml b/.idea/modules.xml new file mode 100644 index 0000000..fcad223 --- /dev/null +++ b/.idea/modules.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/.idea/vcs.xml b/.idea/vcs.xml new file mode 100644 index 0000000..94a25f7 --- /dev/null +++ b/.idea/vcs.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/Ikony/test1_ikona.png b/Ikony/test1_ikona.png new file mode 100644 index 0000000..259cfb1 Binary files /dev/null and b/Ikony/test1_ikona.png differ diff --git a/Ikony/traktor_ikona.png b/Ikony/traktor_ikona.png new file mode 100644 index 0000000..e560e63 Binary files /dev/null and b/Ikony/traktor_ikona.png differ diff --git a/main.py b/main.py new file mode 100644 index 0000000..23edd39 --- /dev/null +++ b/main.py @@ -0,0 +1,36 @@ +import os + +import pygame + +FPS = 60 +SZEROKOSC_OKNA = 800 +WYSOKOSC_OKNA = 600 +BIALY = (255, 255, 255) + +OKNO = pygame.display.set_mode((SZEROKOSC_OKNA, WYSOKOSC_OKNA)) +pygame.display.set_caption("Okno1") + +TEST1_IKONA = pygame.transform.scale(pygame.image.load(os.path.join('Ikony', 'test1_ikona.png')), (500, 500)) +TRAKTOR_IKONA = pygame.transform.scale(pygame.image.load(os.path.join('Ikony', 'traktor_ikona.png')), (100, 100)) + + +def wyswietl_okno(): + OKNO.fill(BIALY) + OKNO.blit(TEST1_IKONA, + (SZEROKOSC_OKNA / 2 - TEST1_IKONA.get_width() / 2, WYSOKOSC_OKNA / 2 - TEST1_IKONA.get_height() / 2)) + OKNO.blit(TRAKTOR_IKONA, (0, 0)) + pygame.display.update() + + +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 + + wyswietl_okno() + +pygame.quit()