spacepaste

  1.  
  2. #starting pygame
  3. import sys, pygame, pygame.mixer, time
  4. from pygame.locals import *
  5. pygame.init()
  6. #screen size
  7. size = width, hight = 600, 400
  8. #creats screen
  9. screen = pygame.display.set_mode(size)
  10. #color
  11. back_ground_color = 0, 0, 0
  12. #loading image
  13. image = pygame.image.load("C:\Sh1tZ\Programing\madara4.png")
  14. #loading sound
  15. sound = pygame.mixer.Sound("C:\Sh1tZ\Programing\water.wav")
  16. sound.play()
  17. #coordinates
  18. x = 0
  19. y = 0
  20. r = 0
  21. #loop till exit
  22. while 1:
  23. time.sleep(0.001)
  24. #event = user input
  25. for event in pygame.event.get():
  26. if event.type == pygame.QUIT:
  27. sys.exit()
  28. #looks for keyboard press & key_escape to exit.
  29. elif event.type == KEYDOWN and event.key == K_ESCAPE:
  30. sys.exit()
  31. #elif event.type == MOUSEBUTTONDOWN:
  32. # sound.play()
  33. #time.sleep(2)
  34. #fills screen
  35. screen.fill((r, 0, 0))
  36. #blit = pasting onto screen
  37. screen.blit(image, (x, y)) # <-- and where on the screen
  38. #re-draw's screen
  39. pygame.display.flip()
  40. x = x + 1
  41. y = y + 1
  42. if r == 255:
  43. r1 = -1
  44. elif r == 0:
  45. r1 = 1
  46. r = r + r1
  47.