MAKS_Enjoyer

I need sleep

Sep 3rd, 2022 (edited)
105
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 7.46 KB | Source Code | 0 0
  1. Link to the exe file: https://mega.nz/file/45R2lKqa
  2. Decryption key: ZwMNfhbJ-SzO-YK2IdTIIhbcg46NWDunEPNqGPPBDmQ
  3.  
  4. import sys
  5. import webbrowser
  6. import pygame
  7.  
  8. pygame.init()
  9. width, height = 1000, 600
  10. clock = pygame.time.Clock()
  11. screen = pygame.display.set_mode((width, height))
  12. Blue = (0,0,255)
  13. White = (255,255,255)
  14. Light_Blue = (180, 221, 255)
  15. Gray = (200, 200, 200)
  16. Dark_Gray = (20, 20, 20)
  17. #------------------------------------------------------------------
  18. Btn_sps = 10
  19. cntrx = (width/6)
  20.  
  21. # main button
  22. btnw1, btnh1 = 220, 75
  23. xs1 = cntrx - (btnw1/2)
  24. ys1 = 200
  25. neil1 = [xs1, ys1, btnw1, btnh1]
  26. jim_bob1 = tuple(neil1)
  27. random_gen = pygame.Rect(jim_bob1)
  28. btnw2, btnh2 = 220, 75
  29. xs2 = cntrx - (btnw2/2)
  30. ys2 = ys1 + 85
  31. neil2 = [xs2, ys2, btnw2, btnh2]
  32. jim_bob2 = tuple(neil2)
  33. basic_gen = pygame.Rect(jim_bob2)
  34. btnw3, btnh3 = 220, 75
  35. xs3 = cntrx - (btnw3/2)
  36. ys3 = ys2 + 85
  37. neil3 = [xs3, ys3, btnw3, btnh3]
  38. jim_bob3 = tuple(neil3)
  39. advanced_gen = pygame.Rect(jim_bob3)
  40.  
  41. # credits + guide
  42. btnw4, btnh4 = 103, 42
  43. xs4 = (cntrx - 57) - (btnw4/2)
  44. ys4 = ys3 + 85
  45. neil4 = [xs4, ys4, btnw4, btnh4]
  46. jim_bob4 = tuple(neil4)
  47. guide = pygame.Rect(jim_bob4)
  48. btnw5, btnh5 = 103, 42
  49. xs5 = (cntrx + 57) - (btnw5/2)
  50. ys5 = ys3 + 85
  51. neil5 = [xs5, ys5, btnw5, btnh5]
  52. jim_bob5 = tuple(neil5)
  53. credits = pygame.Rect(jim_bob5)
  54.  
  55. # exit
  56. btnw6, btnh6 = 50, 20
  57. xs6 = 10
  58. ys6 = 572
  59. neil6 = [xs6, ys6, btnw6, btnh6]
  60. jim_bob6 = tuple(neil6)
  61. exit_btn = pygame.Rect(jim_bob6)
  62.  
  63. # social media
  64. btnw8, btnh8 = 40, 40
  65. xs8 = 882 - (btnw8)
  66. ys8 = 585 - (btnh8)
  67. neil8 = [xs8, ys8, btnw8, btnh8]
  68. jim_bob8 = tuple(neil8)
  69. reddit_btn = pygame.Rect(jim_bob8)
  70. btnw9, btnh9 = 40, 40
  71. xs9 = (xs8 + (btnw9+Btn_sps))
  72. ys9 = 585 - (btnh9)
  73. neil9 = [xs9, ys9, btnw9, btnh9]
  74. jim_bob9 = tuple(neil9)
  75. discord_btn = pygame.Rect(jim_bob9)
  76. btnw10, btnh10 = 40, 40
  77. xs10 = (xs9 + (btnw10+Btn_sps))
  78. ys10 = 585 - (btnh10)
  79. neil10 = [xs10, ys10, btnw10, btnh10]
  80. jim_bob10 = tuple(neil10)
  81. web_btn = pygame.Rect(jim_bob10)
  82.  
  83. def render():
  84.     screen.fill((Dark_Gray))
  85.     pygame.draw.rect(screen, Gray, random_gen)
  86.     pygame.draw.rect(screen, Gray, basic_gen)
  87.     pygame.draw.rect(screen, Gray, advanced_gen)
  88.     pygame.draw.rect(screen, Gray, guide)
  89.     pygame.draw.rect(screen, Gray, credits)
  90.     pygame.draw.rect(screen, Gray, exit_btn)
  91.     pygame.draw.rect(screen, Gray, reddit_btn)
  92.     pygame.draw.rect(screen, Gray, discord_btn)
  93.     pygame.draw.rect(screen, Gray, web_btn)
  94.     #------------------------------------------------------------------
  95.     (x, y, width, height) = (360, 158, 620, 370)
  96.     border_width = 3
  97.     pygame.draw.rect(screen, Dark_Gray, (x, y, width, height))
  98.     pygame.draw.rect(screen, Gray, (x, y, width, height), width=border_width)
  99.     #-------------------------------------------------------------------
  100.     font1 = pygame.font.SysFont("Garamond", 90)
  101.     textsurface1 = font1.render("Rocket Engine Builder", False, Gray)  
  102.     jim1 = textsurface1.get_rect(center = screen.get_rect().center)
  103.     jim1[1] = 28
  104.     screen.blit(textsurface1, jim1)
  105.     #-------------------------------------------------------------------
  106.     font2 = pygame.font.SysFont("Arial", 19, True)
  107.     textsurface2 = font2.render("Choose a configuration:", False, Gray)    
  108.     jim2 = textsurface2.get_rect(center = screen.get_rect().center)
  109.     jim2[0] = 55
  110.     jim2[1] = 164
  111.     screen.blit(textsurface2, jim2)
  112.     #-------------------------------------------------------------------
  113.     font2 = pygame.font.SysFont("Arial", 18)
  114.     textsurface2 = font2.render("Random Generation", False, Dark_Gray)  
  115.     jim2 = textsurface2.get_rect(center = screen.get_rect().center)
  116.     jim2[0] = cntrx - 80
  117.     jim2[1] = ys1 + 25
  118.     screen.blit(textsurface2, jim2)    
  119.     #-------------------------------------------------------------------
  120.     font2 = pygame.font.SysFont("Arial", 18)
  121.     textsurface2 = font2.render("Basic Generation", False, Dark_Gray)  
  122.     jim2 = textsurface2.get_rect(center = screen.get_rect().center)
  123.     jim2[0] = cntrx - 71
  124.     jim2[1] = ys1 + 110
  125.     screen.blit(textsurface2, jim2)      
  126.     #-------------------------------------------------------------------
  127.     font2 = pygame.font.SysFont("Arial", 18)
  128.     textsurface2 = font2.render("Advanced Generation", False, Dark_Gray)  
  129.     jim2 = textsurface2.get_rect(center = screen.get_rect().center)
  130.     jim2[0] = cntrx - 86
  131.     jim2[1] = ys2 + 111
  132.     screen.blit(textsurface2, jim2)            
  133.     #-------------------------------------------------------------------
  134.     font3 = pygame.font.SysFont("Garamond", 22)
  135.     textsurface3 = font3.render("EXIT", False, Dark_Gray)
  136.     jim3 = [17,575]
  137.     screen.blit(textsurface3, jim3)        
  138.     #-------------------------------------------------------------------
  139.     pygame.display.update()
  140.  
  141. def main():
  142.     clock.tick(60)
  143.     run = True
  144.     while run:
  145.         for event in pygame.event.get():
  146.             if event.type == pygame.QUIT:
  147.                 run = False
  148.             if event.type == pygame.MOUSEBUTTONDOWN:
  149.                 mouse_pos = event.pos
  150.                 if random_gen.collidepoint(mouse_pos):
  151.                     jim2 = [610,132]
  152.                     #-------------------------------------------------------------------                      
  153.                     print("The random generation button was pressed")
  154.                     font2 = pygame.font.SysFont("Arial", 18)
  155.                     textsurface2 = font2.render("Random Generation", False, Gray)
  156.                     screen.blit(textsurface2, jim2)  
  157.                     #-------------------------------------------------------------------  
  158.                 if basic_gen.collidepoint(mouse_pos):
  159.                     print("The basic generation was pressed")
  160.                     font3 = pygame.font.SysFont("Arial", 18)
  161.                     textsurface3 = font3.render("Basic Generation", False, Gray)
  162.                     screen.blit(textsurface3, jim2)    
  163.                     #-------------------------------------------------------------------
  164.                 if advanced_gen.collidepoint(mouse_pos):
  165.                     print("The advanced generation was pressed")
  166.                     font4 = pygame.font.SysFont("Arial", 18)
  167.                     textsurface4 = font4.render("Advanced Geneneration", False, Gray)
  168.                     screen.blit(textsurface4, jim2)
  169.                     #-------------------------------------------------------------------    
  170.                 if guide.collidepoint(mouse_pos):
  171.                     print("The guide button was pressed")
  172.                 if credits.collidepoint(mouse_pos):
  173.                     print("The credits button was pressed")                    
  174.                 if reddit_btn.collidepoint(mouse_pos):
  175.                     print("The reddit button was pressed")
  176.                     webbrowser.open(r"https://reddit.com/")    
  177.                 if discord_btn.collidepoint(mouse_pos):
  178.                     print("The discord button was pressed")
  179.                     webbrowser.open(r"https://youtube.com/")    
  180.                 if web_btn.collidepoint(mouse_pos):
  181.                     print("The website button was pressed")
  182.                     webbrowser.open(r"https://stackoverflow.com/")      
  183.                 if exit_btn.collidepoint(mouse_pos):
  184.                     print("The exit button was pressed")
  185.                     sys.exit()                                                                                        
  186.         render()        
  187.     pygame.quit()    
  188. main()
Add Comment
Please, Sign In to add comment