OtsoSilver

Untitled

Sep 4th, 2021
975
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.75 KB | None | 0 0
  1. import pygame
  2. import random
  3.  
  4. #Настройки окна
  5. WIDTH = 500
  6. HEIGHT = 500
  7. FPS = 60
  8.  
  9. #Настройка цвета
  10. BLACK = (0,0,0)
  11. WHITE = (255,255,255)
  12. RED = (255,0,0)
  13. BLUE = (0,0,255)
  14.  
  15. #Инициализация
  16. pygame.init()
  17. screen = pygame.display.set_mode((WIDTH,HEIGHT))
  18. clock = pygame.time.Clock()
  19.  
  20. #Время
  21. lastTime = 0
  22. currentTime = 0
  23.  
  24. #Hero
  25. x = 250
  26. y = 250
  27. heroImg = pygame.image.load("razorinv.png")
  28. hero = pygame.Rect(x,y, 60, 50)
  29.  
  30. moving = ''
  31. running = True
  32. while running:
  33.     for i in pygame.event.get():
  34.         if i.type == pygame.QUIT:
  35.             running = False
  36.     screen.fill(BLACK)
  37.     screen.blit(heroImg , (hero.left, hero.top))
  38.     pygame.display.update()
  39.     clock.tick(FPS)
  40. pygame.quit()
Advertisement
Add Comment
Please, Sign In to add comment