-
Notifications
You must be signed in to change notification settings - Fork 144
Expand file tree
/
Copy pathmain.py
More file actions
43 lines (31 loc) · 1.25 KB
/
main.py
File metadata and controls
43 lines (31 loc) · 1.25 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
import pygame
from helpers import screen
from constants import WINDOW_WIDTH, WINDOW_HEIGHT, BLACK
def main():
# Set up the game display, clock and headline
pygame.init()
# Change the title of the window
pygame.display.set_caption('Nitzagram')
clock = pygame.time.Clock()
# Set up background image
background = pygame.image.load('Images/background.png')
background = pygame.transform.scale(background,
(WINDOW_WIDTH, WINDOW_HEIGHT))
# TODO: add a post here
running = True
while running:
# Grabs events such as key pressed, mouse pressed and so.
# Going through all the events that happened in the last clock tick
for event in pygame.event.get():
if event.type == pygame.QUIT:
running = False
# Display the background, presented Image, likes, comments, tags and location(on the Image)
screen.fill(BLACK)
screen.blit(background, (0, 0))
# Update display - without input update everything
pygame.display.update()
# Set the clock tick to be 60 times per second. 60 frames for second.
clock.tick(60)
pygame.quit()
quit()
main()