From c17be3e11c404a984c9938aa4cbd55a4bb3f749e Mon Sep 17 00:00:00 2001 From: ada-dmitry Date: Fri, 23 Feb 2024 20:16:57 +0300 Subject: [PATCH] start project --- __pycache__/settings.cpython-311.pyc | Bin 0 -> 730 bytes main.py | 28 +++++++++++++++++++++++++++ settings.py | 6 ++++++ 3 files changed, 34 insertions(+) create mode 100644 __pycache__/settings.cpython-311.pyc create mode 100644 main.py create mode 100644 settings.py diff --git a/__pycache__/settings.cpython-311.pyc b/__pycache__/settings.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..eaafae1abff6c3fe8e8e75d864d7f5969ca42a49 GIT binary patch literal 730 zcmZuvy^GX96n~S+VmNP$vpR%@SZN9mJ3&NH3pqHp@CqRWhBY(p4d#+{CaauS>>Vd; zAy_W>2Pk5*g@SnK-!Ku2C9NRXt*q5mzS(TjoNt)l`V6sDE0g z7I$SVd^9HDz&+q_44k}m06yTYBn0m4LO|m>U^Q7ei%m2pARr_hLWh%(a_1OAms9-4 zExlcl=Q8c<;T=pgZ_J6A7Kg>5Z$6rn;pkqVI7>1WkkZv6d8BPE|MV)q5k1J%Lv}RXK^VcTb7}1U@Gj0eex)}rkKI@8 zF`fk`KsRVvsubxNE7us?&-gI0_BvxvhP`Cc#f+)*_|bb%>!_6dLzFGH1UrTf z5Jt_JxjV+)nLD&~We#VdVzC6>fK)^qmaQQ_^=?-E+)@|tVOili8gohrnL90lv}fUu Ljs5-4!;<(PL_)o> literal 0 HcmV?d00001 diff --git a/main.py b/main.py new file mode 100644 index 0000000..d755fd3 --- /dev/null +++ b/main.py @@ -0,0 +1,28 @@ +import sys +import pygame +from settings import Settings + +class AlienInvasion(): + '''Класс всей игры''' + + def __init__(self): + pygame.init() + self.settings = Settings() + # Поменять разрешение + self.screen = pygame.display.set_mode((self.settings.screen_weight, self.settings.screen_height)) + pygame.display.set_caption("Alien Invasion") + + def run_game(self): + '''Запуск игры''' + while(1): + for event in pygame.event.get(): + if event.type == pygame.QUIT: + sys.exit() + pygame.display.flip() + # Установить цвет фона из настроек + self.screen.fill(self.settings.bg_color) + +if __name__ == '__main__': + AlInv = AlienInvasion() + AlInv.run_game() + \ No newline at end of file diff --git a/settings.py b/settings.py new file mode 100644 index 0000000..f6ceaba --- /dev/null +++ b/settings.py @@ -0,0 +1,6 @@ +class Settings(): + '''Класс для хранения настроек Alien Invasion''' + def __init__(self): + self.screen_weight = 1200 + self.screen_height = 800 + self.bg_color = (230, 230, 230) \ No newline at end of file