SHARE
TWEET

m kek

a guest Apr 24th, 2019 82 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. def show_intro(app):
  2.     # press any button to start animation
  3.     key_not_pressed = True
  4.     label = pygame.image.load('intro/label.png')
  5.     logo = pygame.image.load('intro/logo.bmp')
  6.     label_height = 59
  7.     label_width = 439
  8.     logo_x = (SCREEN_RES[0] - logo_width) // 2
  9.     logo_y = (SCREEN_RES[1] - bar_height - logo_height) // 2
  10.     x = (SCREEN_RES[0] - label_width) // 2
  11.     y = (SCREEN_RES[1] - label_height) - bar_height*2
  12.     velocity = 1
  13.     animation_frame_rate = 30
  14.     top_border = (SCREEN_RES[1] - label_height) - bar_height*2
  15.     bottom_border = (SCREEN_RES[1] - label_height) - bar_height - 10
  16.     moving_down = True
  17.  
  18.     while key_not_pressed:
  19.         app.clock.tick(animation_frame_rate)
  20.         for event in pygame.event.get():
  21.             if event.type == pygame.QUIT:
  22.                 pygame.quit()
  23.                 sys.exit(0)
  24.             elif event.type == pygame.KEYUP:
  25.                 key_not_pressed = False
  26.         pygame.draw.rect(app.win, color_green_light, (0, 0, SCREEN_RES[0], SCREEN_RES[1]))
  27.         app.win.blit(logo, (logo_x, logo_y))
  28.         if moving_down:
  29.             y += velocity
  30.             if y >= bottom_border:
  31.                 moving_down = False
  32.         else:
  33.             y -= velocity
  34.             if y <= top_border:
  35.                 moving_down = True
  36.         app.win.blit(label, (x, y))
  37.         pygame.display.update()
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top