initial commit
This commit is contained in:
commit
39f56a3b10
83 files changed
+3583
No files matched your search
@@ -0,0 +1,45 @@
|
||||
import pygame
|
||||
|
||||
from Prog_1.Pygame_games.first_games import draw_game, update_game
|
||||
|
||||
width = 800
|
||||
height = 600
|
||||
SIZE = (width, height)
|
||||
|
||||
def main():
|
||||
screen = init_game()
|
||||
game_loop(screen)
|
||||
exit_game()
|
||||
|
||||
def init_game():
|
||||
pygame.init()
|
||||
screen = pygame.display.set_mode(SIZE)
|
||||
return screen
|
||||
|
||||
def game_loop(screen):
|
||||
while True:
|
||||
if event_handling() == False:
|
||||
break
|
||||
if update_game() == False:
|
||||
break
|
||||
event = event_handling()
|
||||
update_game()
|
||||
draw_game(screen)
|
||||
|
||||
def event_handling():
|
||||
for event in pygame.event.get():
|
||||
if event.type == pygame.QUIT:
|
||||
return False
|
||||
return True
|
||||
|
||||
def update_game():
|
||||
return True
|
||||
|
||||
def draw_screen(screen):
|
||||
screen.fill("BLACK")
|
||||
pygame.display.flip()
|
||||
|
||||
def exit_game():
|
||||
pygame.quit()
|
||||
|
||||
main()
|
||||
Reference in new issue
Block a user