Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import pygame
- pygame.init() # initializes the graphics module
- window = pygame.display.set_mode((1000, 600)) # define window size
- pygame.display.set_caption("Loading/Beginning_Screen") # title of program that
- # appears on window frame
- clock = pygame.time.Clock() # used to track time within the game (FPS)
- quit = False
- y = 0
- pygame.mixer.music.load("Opening Song.mp3")
- pygame.mixer.music.play(-1)
- black = (0, 0, 0)
- white = [225, 225, 225]
- background = pygame.image.load("uwu.png").convert()
- window.blit(background, [0, 0])
- while not quit: # main program loop
- for event in pygame.event.get(): # check if there were any events
- if event.type == pygame.QUIT: # check if user clicked the upper
- quit = True # right quit button
- elif event.type == pygame.KEYDOWN:
- if event.key == pygame.K_ESCAPE:
- quit = True
- if event.key == pygame.K_SPACE:
- pygame.mixer.music.stop()
- pygame.mixer.music.load("Button Effect 1.mp3")
- pygame.mixer.music.play(0)
- transition = pygame.image.load("maxresdefault.jpg").convert()
- pygame.display.flip()
- window.blit(transition, [0, 0])
- pygame.display.update()
- if event.key == pygame.K_i:
- background = pygame.image.load("uwu.png").convert()
- if event.key == pygame.K_RETURN:
- pygame.mixer.music.stop()
- pygame.mixer.music.load("Button Effect 1.mp3")
- pygame.mixer.music.play(0)
- pygame.mixer.music.load("InGame Audio.mp3")
- pygame.mixer.music.play(-1)
- # your code that draws to the window goes here
- # background = pygame.image.load("uwu.png").convert()
- # window.blit(background, [0, 0]) after you changed the background you change it back to the art so it only flashes reallly quick
- pygame.display.update()
- #pygame.display.update() # refresh your display
- clock.tick(60) # wait a certain amount of time that
- # ensures a frame rate of 60 fps
- pygame.quit() # shutdown module
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement