Browse Source

Add files via upload

PythonCoder8 4 years ago
parent
commit
80fe1305d3
1 changed files with 19 additions and 0 deletions
  1. 19 0
      hello_world.py

+ 19 - 0
hello_world.py

@@ -0,0 +1,19 @@
+import pygame, sys
+
+pygame.init()
+winSize = (800, 600)
+screen = pygame.display.set_mode(winSize)
+
+#Load font and render text
+myriadProFont = pygame.font.SysFont('Myriad Pro', 48)
+helloWorld = myriadProFont.render('Hello World!', 1, (255, 0, 255), (255, 255, 255))
+
+while True:
+
+    #Keep screen open and let user exit window using for loop
+    for ev in pygame.event.get():
+        if ev.type == pygame.QUIT:
+            sys.exit()
+
+    screen.blit(helloWorld, (0, 0))
+    pygame.display.update()