Advertisement
Guest User

Untitled

a guest
Dec 15th, 2019
104
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.89 KB | None | 0 0
  1. import pygame
  2.  
  3. pygame.init() # initializes the graphics module
  4. window = pygame.display.set_mode((1000, 600)) # define window size
  5. pygame.display.set_caption("Loading/Beginning_Screen") # title of program that
  6. # appears on window frame
  7. clock = pygame.time.Clock() # used to track time within the game (FPS)
  8. quit = False
  9.  
  10. y = 0
  11.  
  12. pygame.mixer.music.load("Opening Song.mp3")
  13. pygame.mixer.music.play(-1)
  14.  
  15. black = (0, 0, 0)
  16. white = [225, 225, 225]
  17.  
  18. background = pygame.image.load("uwu.png").convert()
  19. window.blit(background, [0, 0])
  20.  
  21. while not quit: # main program loop
  22. for event in pygame.event.get(): # check if there were any events
  23. if event.type == pygame.QUIT: # check if user clicked the upper
  24. quit = True # right quit button
  25. elif event.type == pygame.KEYDOWN:
  26. if event.key == pygame.K_ESCAPE:
  27. quit = True
  28. if event.key == pygame.K_SPACE:
  29. pygame.mixer.music.stop()
  30. pygame.mixer.music.load("Button Effect 1.mp3")
  31. pygame.mixer.music.play(0)
  32. transition = pygame.image.load("maxresdefault.jpg").convert()
  33. pygame.display.flip()
  34. window.blit(transition, [0, 0])
  35. pygame.display.update()
  36. if event.key == pygame.K_i:
  37. background = pygame.image.load("uwu.png").convert()
  38. if event.key == pygame.K_RETURN:
  39. pygame.mixer.music.stop()
  40. pygame.mixer.music.load("Button Effect 1.mp3")
  41. pygame.mixer.music.play(0)
  42. pygame.mixer.music.load("InGame Audio.mp3")
  43. pygame.mixer.music.play(-1)
  44. # your code that draws to the window goes here
  45. # background = pygame.image.load("uwu.png").convert()
  46. # window.blit(background, [0, 0]) after you changed the background you change it back to the art so it only flashes reallly quick
  47. pygame.display.update()
  48.  
  49.  
  50. #pygame.display.update() # refresh your display
  51. clock.tick(60) # wait a certain amount of time that
  52. # ensures a frame rate of 60 fps
  53. pygame.quit() # shutdown module
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement