Advertisement
Jump_off_a_cliff

IMPOSSIBLE GAME // Github Copilot

May 28th, 2022
705
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. # Import pygame and create a start menu
  2. import pygame
  3. from pygame.locals import *
  4. from sys import exit
  5. from random import randint
  6.  
  7. # Create a start menu
  8.  
  9.  
  10. def start_menu():
  11.     # Initialize pygame
  12.     pygame.init()
  13.     # Create a screen
  14.     screen = pygame.display.set_mode((640, 480), 0, 32)
  15.     # Create a font
  16.     font = pygame.font.SysFont("arial", 32)
  17.     # Create a text
  18.     text = font.render("Press any key to start", True, (255, 255, 255))
  19.     # Create a rectangle
  20.     rect = text.get_rect()
  21.     # Create a center
  22.     center = rect.center
  23.  
  24.     # Create a loop
  25.     while True:
  26.         # Create a event
  27.         for event in pygame.event.get():
  28.             # Create a quit event
  29.             if event.type == QUIT:
  30.                 exit()
  31.             # Create a keydown event
  32.             if event.type == KEYDOWN:
  33.                 # Create a return
  34.                 return
  35.         # Create a screen
  36.         screen.fill((0, 0, 0))
  37.         # Create a screen
  38.         screen.blit(text, center)
  39.         # Create a screen
  40.         pygame.display.update()
  41.  
  42.     # Create a function
  43.  
  44.  
  45. def game_over():
  46.     # Initialize pygame
  47.     pygame.init()
  48.     # Create a screen
  49.     screen = pygame.display.set_mode((640, 480), 0, 32)
  50.     # Create a font
  51.     font = pygame.font.SysFont("arial", 32)
  52.     # Create a text
  53.     text = font.render("Game Over", True, (255, 255, 255))
  54.     # Create a rectangle
  55.     rect = text.get_rect()
  56.     # Create a center
  57.     center = rect.center
  58.  
  59.     # Create a loop
  60.     while True:
  61.         # Create a event
  62.         for event in pygame.event.get():
  63.             # Create a quit event
  64.             if event.type == QUIT:
  65.                 exit()
  66.             # Create a keydown event
  67.             if event.type == KEYDOWN:
  68.                 # Create a return
  69.                 return
  70.         # Create a screen
  71.         screen.fill((0, 0, 0))
  72.         # Create a screen
  73.         screen.blit(text, center)
  74.         # Create a screen
  75.         pygame.display.update()
  76.  
  77.     # Create a function
  78.  
  79.  
  80. def main():
  81.     # Create a start menu
  82.     start_menu()
  83.     # Create a function
  84.     game_over()
  85.  
  86.  
  87. main()
  88.  
Advertisement
RAW Paste Data Copied
Advertisement