Skip to content

Commit

Permalink
Merge pull request jjunkergamedev#1 from jjunkergamedev/junker/pygame…
Browse files Browse the repository at this point in the history
…_setup

Basic Pygame Window
  • Loading branch information
jjunkergamedev authored Dec 29, 2017
2 parents f81b222 + 71ea2dc commit e5027e3
Showing 1 changed file with 32 additions and 1 deletion.
33 changes: 32 additions & 1 deletion src/main.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,33 @@

import pygame
from pygame.locals import *

FRAMES_PER_SECOND = 30

def run():
print("running...")
screen = pygame.display.set_mode((1024, 768))
clock = pygame.time.Clock()
shouldQuit = False

# game loop
while True:
deltaTime = clock.tick(FRAMES_PER_SECOND)

for event in pygame.event.get():
if event.type == pygame.QUIT:
shouldQuit = True

if not hasattr(event, 'key'):
continue
if event.key == K_ESCAPE:
shouldQuit = True

if shouldQuit:
break

screen.fill((0, 0, 0))
pygame.display.flip()

if __name__ == "__main__":
print("Hello World!")
run()

0 comments on commit e5027e3

Please sign in to comment.