/
cloufire
/
Space-Invaders
Обзор
Документация
Войти
/
cloufire
/
Space-Invaders
Код
Запросы
0
Пакеты
0
Релизы
0
CI/CD
Аналитика
Безопасность
master
main.py
29 строк
833 B
cloufire
final commit
02 апр 2024, 23:36
02 апр 2024, 23:36
d0d526c
Код
Авторство
О чём код?
import pygame from Gun import Gun import Control as c from pygame.sprite import Group from Statisctics import Statistic from Score import Score def run(): pygame.init() screen = pygame.display.set_mode((700, 800)) pygame.display.set_caption('Space Invaders') bg_color = (0, 0, 0) gun = Gun(screen ) enemys = Group() bullets = Group() c.create_army(screen, enemys) stats = Statistic() score = Score(screen, stats) while True: if stats.run_game: c.events(gun, screen, bullets) gun.pos() c.draw(screen=screen, bg_color=bg_color, gun=gun, enemys=enemys, bullets=bullets, stats=stats, score=score) c.update_bullets(screen, stats, score, enemys, bullets) c.update_enemys(stats, screen, gun, enemys, bullets, score) run()