ClearCode

SimpleZelda main

Jan 18th, 2022 (edited)
8,874
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.49 KB | None | 0 0
  1. import pygame, sys
  2. from settings import *
  3.  
  4. class Game:
  5.     def __init__(self):
  6.          
  7.         # general setup
  8.         pygame.init()
  9.         self.screen = pygame.display.set_mode((WIDTH,HEIGTH))
  10.         self.clock = pygame.time.Clock()
  11.    
  12.     def run(self):
  13.         while True:
  14.             for event in pygame.event.get():
  15.                 if event.type == pygame.QUIT:
  16.                     pygame.quit()
  17.                     sys.exit()
  18.  
  19.             self.screen.fill('black')
  20.             pygame.display.update()
  21.             self.clock.tick(FPS)
  22.  
  23. if __name__ == '__main__':
  24.     game = Game()
  25.     game.run()
Add Comment
Please, Sign In to add comment