Advertisement
mProger

Untitled

Jul 1st, 2021
1,721
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. import pygame as pg
  2. from object_3d import Object3D
  3.  
  4.  
  5. class Game:
  6.  
  7.     def __init__(self):
  8.         self.caption = 'Sprite Stacking viewer'
  9.         self.screen_width = 1280
  10.         self.screen_height = 720
  11.         self.fps = 60
  12.  
  13.     def run(self):
  14.         pg.init()
  15.         screen = pg.display.set_mode((self.screen_width, self.screen_height))
  16.         pg.display.set_caption(self.caption)
  17.  
  18.         clock = pg.time.Clock()
  19.  
  20.         obj = Object3D(self.screen_width//2, self.screen_height//2, '../Desktop/Цвета RGB/',7,screen)
  21.  
  22.         while True:
  23.             for event in pg.event.get():
  24.                 if event.type == pg.QUIT:
  25.                     quit()
  26.                 if event.type == pg.KEYDOWN:
  27.                     if event.key == pg.K_ESCAPE:
  28.                         quit()
  29.  
  30.             screen.fill((50, 50, 50))
  31.  
  32.             obj.blit_me_3d()
  33.  
  34.             pg.display.flip()
  35.             clock.tick(self.fps)
  36.  
  37.  
  38. if __name__ == '__main__':
  39.     game = Game()
  40.     game.run()
  41.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement