Created
June 17, 2017 10:27
-
-
Save iamutkarshtiwari/7c5731a48726fb58526417edb2f61c15 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import sys | |
| import pygame | |
| import time | |
| import random | |
| import os | |
| WIDTH = 360 | |
| HEIGHT = 360 | |
| FPS = 360 | |
| pygame.init() | |
| pygame.mixer.init() | |
| screen = pygame.display.set_mode((WIDTH, HEIGHT)) | |
| pygame.display.set_caption("My Game") | |
| clock = pygame.time.Clock() | |
| # Variables | |
| img1 = pygame.image.load(os.path.abspath("watercycle.png")) | |
| # Game Loop | |
| running = True | |
| while running: | |
| # keep loop running at the right speed | |
| clock.tick(FPS) | |
| # Process input (events) | |
| for event in pygame.event.get(): | |
| # check for closing window | |
| if event.type == pygame.QUIT: | |
| running = False | |
| screen.fill(BLACK) | |
| screen.flip(img1) | |
| # after drawing everything, flip the display | |
| pygame.display.flip() | |
| pygame.quit() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment